Skip to content

Commit

Permalink
Move from debian-hyperkube-base to debian-base
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Menezes committed Aug 28, 2020
1 parent 26ca2ad commit d1d6336
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
17 changes: 8 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ gazelle_dependencies()

http_archive(
name = "io_bazel_rules_docker",
sha256 = "14ac30773fdb393ddec90e158c9ec7ebb3f8a4fd533ec2abbfd8789ad81a284b",
strip_prefix = "rules_docker-0.12.1",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz"],
sha256 = "dc97fccceacd4c6be14e800b2a00693d5e8d07f69ee187babfd04a80a9f8e250",
strip_prefix = "rules_docker-0.14.1",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.1/rules_docker-v0.14.1.tar.gz"],
)

load(
Expand All @@ -51,20 +51,19 @@ load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()

# Note: We can't (easily) use distroless because we need: fsck, blkid, mount, others? to mount disks
# We also have to use debian-hyperkube-base because we need nsenter / fsck

load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)

container_pull(
name = "debian-hyperkube-base-amd64",
name = "debian-base-amd64",
architecture = "amd64",
digest = "sha256:5d4ea2fb5fbe9a9a9da74f67cf2faefc881968bc39f2ac5d62d9167e575812a1",
registry = "k8s.gcr.io",
repository = "debian-hyperkube-base",
tag = "0.12.1", # ignored, but kept here for documentation
digest = "sha256:dc06e242160076b72bd75135fb3dd0a9e91f386b2d812ec10cbf9e65864c755d",
registry = "k8s.gcr.io/build-image",
repository = "debian-base-amd64",
tag = "v2.1.3", # ignored, but kept here for documentation
)

#=============================================================================
Expand Down
22 changes: 21 additions & 1 deletion images/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,29 @@ container_layer(
],
)

load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs")
load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs")

# Install deps because we need nsenter / fsck
download_pkgs(
name = "required_pkgs",
image_tar = "@debian-base-amd64//image:image.tar",
packages = [
"mount",
"util-linux",
],
)

install_pkgs(
name = "debian-base-with-req-pkgs-amd64",
image_tar = "@debian-base-amd64//image:image.tar",
installables_tar = ":required_pkgs.tar",
output_image_name = "debian-base-with-req-pkgs-amd64",
)

container_image(
name = "etcd-manager-base",
base = "@debian-hyperkube-base-amd64//image",
base = ":debian-base-with-req-pkgs-amd64",
directory = "/opt",
layers = [
"etcd-2-2-1-layer",
Expand Down

0 comments on commit d1d6336

Please sign in to comment.