This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
/
BUILD
52 lines (46 loc) · 1.63 KB
/
BUILD
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
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_image",
"container_layer",
"container_push",
)
packages = [
"e2fsprogs", # For mkfs.ext4
"libext2fs2", # needed by e2fsprogs
"libcom-err2", # needed by e2fsprogs
"libblkid1", # needed by e2fsprogs
"libuuid1", # needed by e2fsprogs
"util-linux", # For blkid
"mount", # For mount & umount
"libmount1", # Needed by mount
"libselinux1", # Needed by mount
"libpcre3", # Needed by libselinux1
"dash", # Needed for shell (for dual logging)
"coreutils", # General tools
"libacl1", # Needed by coreutils
"libattr1", # Needed by coreutils
]
architectures = [
"amd64",
"arm64",
]
[genrule(
name = "pkg_tar_%s_%s" % (pkg, arch),
srcs = ["@debian_packages_gz_%s//file" % (arch)],
outs = ["%s_%s.tar" % (pkg, arch)],
cmd = "./$(location @deb_tools//:deb-tools) --cache-dir $$TMPDIR --mirror http://snapshot.debian.org/archive/debian/20201101T154040Z/ --out \"$@\" --package %s --packages ./$(location @debian_packages_gz_%s//file)" % (pkg, arch),
tools = ["@deb_tools//:deb-tools"],
visibility = ["//visibility:public"],
) for pkg in packages for arch in architectures]
[container_layer(
name = "pkg_layer_%s_%s" % (pkg, arch),
tars = [
":pkg_tar_%s_%s" % (pkg, arch),
],
) for pkg in packages for arch in architectures]
[container_image(
name = "base_image_%s" % (arch),
base = "@distroless-base-%s//image" % (arch),
tars = [":pkg_tar_%s_%s" % (pkg, arch) for pkg in packages],
) for arch in architectures]