forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
81 lines (73 loc) · 1.61 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_docker//contrib:group.bzl", "group_entry", "group_file")
load("@io_bazel_rules_docker//contrib:passwd.bzl", "passwd_entry", "passwd_file")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
container_image(
name = "kubevirt-testing-base",
architecture = select({
"@io_bazel_rules_go//go/platform:linux_arm64": "arm64",
"//conditions:default": "amd64",
}),
tars = select({
"@io_bazel_rules_go//go/platform:linux_arm64": [
":passwd-tar",
"//rpm:testimage_aarch64",
],
"//conditions:default": [
":passwd-tar",
"//rpm:testimage_x86_64",
],
}),
visibility = ["//visibility:public"],
)
passwd_entry(
name = "root-user",
gid = 0,
home = "/root",
info = "root",
shell = "/bin/bash",
uid = 0,
username = "root",
)
passwd_entry(
name = "nginx-user",
gid = 101,
home = "",
shell = "/bin/bash",
uid = 101,
username = "nginx",
)
passwd_file(
name = "passwd",
entries = [
":nginx-user",
":root-user",
],
)
group_entry(
name = "nginx-group",
gid = 101,
groupname = "nginx",
)
group_entry(
name = "root-group",
gid = 0,
groupname = "root",
)
group_file(
name = "group",
entries = [
":nginx-group",
":root-group",
],
)
pkg_tar(
name = "passwd-tar",
srcs = [
":group",
":passwd",
],
mode = "0644",
package_dir = "etc",
visibility = ["//visibility:public"],
)