prysm-pulse/tools/prysm_image.bzl
Preston Van Loon 8839015312
docker: Add coreutils to docker images (#13564)
* Add coreutils to docker images

* add coreutils dependencies

* Add a prysmaticlabs.com/uploads backup of the deb files

* Run gazelle and fix issues

* Remove broken tar, change http_archive deps to debian_archive, remove http mirrors in favor of snapshot

* Add comments about which deps are required by other deps
2024-02-03 19:21:21 +00:00

77 lines
2.0 KiB
Python

load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:multi_arch.bzl", "multi_arch")
def prysm_image_upload(
name,
binary,
entrypoint,
symlinks,
repository,
tags):
pkg_tar(
name = "binary_tar",
srcs = [binary],
symlinks = symlinks,
tags = tags,
)
oci_image(
name = "oci_image",
base = "@linux_debian11_multiarch_base",
entrypoint = entrypoint,
tars = [
"//tools:passwd_tar",
] + select({
"@platforms//cpu:x86_64": [
"@amd64_debian11_bash",
"@amd64_debian11_libtinfo6",
"@amd64_debian11_coreutils",
"@amd64_debian11_libacl1",
"@amd64_debian11_libattr1",
"@amd64_debian11_libselinux",
"@amd64_debian11_libpcre2",
],
"@platforms//cpu:arm64": [
"@arm64_debian11_bash",
"@arm64_debian11_libtinfo6",
"@arm64_debian11_coreutils",
"@arm64_debian11_libacl1",
"@arm64_debian11_libattr1",
"@arm64_debian11_libselinux",
"@arm64_debian11_libpcre2",
],
}) + [
":binary_tar",
],
labels = {
"org.opencontainers.image.source": "https://github.com/prysmaticlabs/prysm",
},
tags = tags,
)
multi_arch(
name = "oci_multiarch",
image = ":oci_image",
platforms = [
"@io_bazel_rules_go//go/toolchain:linux_amd64_cgo",
"@io_bazel_rules_go//go/toolchain:linux_arm64_cgo",
],
tags = tags,
)
oci_image_index(
name = "oci_image_index",
images = [
":oci_multiarch",
],
tags = tags,
)
oci_push(
name = name,
image = ":oci_image_index",
repository = repository,
tags = tags,
)