bazel: make conformance and hyperkube images multiarch
This commit is contained in:
parent
91bc8095e5
commit
c98b3edb88
@ -1,4 +1,5 @@
|
|||||||
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image", "container_layer")
|
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image", "container_layer")
|
||||||
|
load("//build:platforms.bzl", "SERVER_PLATFORMS", "for_platforms")
|
||||||
|
|
||||||
container_layer(
|
container_layer(
|
||||||
name = "cluster-srcs",
|
name = "cluster-srcs",
|
||||||
@ -19,7 +20,10 @@ container_layer(
|
|||||||
|
|
||||||
container_image(
|
container_image(
|
||||||
name = "conformance-internal",
|
name = "conformance-internal",
|
||||||
base = "@debian-hyperkube-base-amd64//image",
|
base = select(for_platforms(
|
||||||
|
for_server = "@debian-hyperkube-base-{ARCH}//image",
|
||||||
|
only_os = "linux",
|
||||||
|
)),
|
||||||
cmd = [
|
cmd = [
|
||||||
"/bin/bash",
|
"/bin/bash",
|
||||||
"-c",
|
"-c",
|
||||||
@ -44,10 +48,20 @@ container_image(
|
|||||||
workdir = "/usr/local/bin",
|
workdir = "/usr/local/bin",
|
||||||
)
|
)
|
||||||
|
|
||||||
container_bundle(
|
[container_bundle(
|
||||||
name = "conformance",
|
name = "conformance-%s" % arch,
|
||||||
images = {"k8s.gcr.io/conformance-amd64:{STABLE_DOCKER_TAG}": "conformance-internal"},
|
images = {"k8s.gcr.io/conformance-%s:{STABLE_DOCKER_TAG}" % arch: "conformance-internal"},
|
||||||
)
|
tags = ["manual"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
) for arch in SERVER_PLATFORMS["linux"]]
|
||||||
|
|
||||||
|
[alias(
|
||||||
|
name = "conformance%s" % suffix,
|
||||||
|
actual = select(for_platforms(for_server = "conformance-{ARCH}%s" % suffix)),
|
||||||
|
) for suffix in [
|
||||||
|
"",
|
||||||
|
".tar",
|
||||||
|
]]
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "package-srcs",
|
name = "package-srcs",
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
|
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
|
||||||
|
load("//build:platforms.bzl", "SERVER_PLATFORMS", "for_platforms")
|
||||||
|
|
||||||
container_image(
|
container_image(
|
||||||
name = "hyperkube-internal",
|
name = "hyperkube-internal",
|
||||||
base = "@debian-hyperkube-base-amd64//image",
|
base = select(for_platforms(
|
||||||
|
for_server = "@debian-hyperkube-base-{ARCH}//image",
|
||||||
|
only_os = "linux",
|
||||||
|
)),
|
||||||
files = [
|
files = [
|
||||||
"//cmd/hyperkube",
|
"//cmd/hyperkube",
|
||||||
],
|
],
|
||||||
stamp = True,
|
stamp = True,
|
||||||
)
|
)
|
||||||
|
|
||||||
container_bundle(
|
[container_bundle(
|
||||||
name = "hyperkube",
|
name = "hyperkube-%s" % arch,
|
||||||
images = {"k8s.gcr.io/hyperkube-amd64:{STABLE_DOCKER_TAG}": "hyperkube-internal"},
|
images = {"k8s.gcr.io/hyperkube-%s:{STABLE_DOCKER_TAG}" % arch: "hyperkube-internal"},
|
||||||
)
|
tags = ["manual"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
) for arch in SERVER_PLATFORMS["linux"]]
|
||||||
|
|
||||||
|
[alias(
|
||||||
|
name = "hyperkube%s" % suffix,
|
||||||
|
actual = select(for_platforms(for_server = "hyperkube-{ARCH}%s" % suffix)),
|
||||||
|
) for suffix in [
|
||||||
|
"",
|
||||||
|
".tar",
|
||||||
|
]]
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "package-srcs",
|
name = "package-srcs",
|
||||||
|
Loading…
Reference in New Issue
Block a user