Skip to content

Commit

Permalink
chore: remove select() from the examples
Browse files Browse the repository at this point in the history
With the changes in #115 and the previous commit, we can now remove a
bunch of select from the examples and use the new target aliases.
  • Loading branch information
jjmaestro committed Dec 3, 2024
1 parent b953eb7 commit 5c38a79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 72 deletions.
36 changes: 2 additions & 34 deletions examples/debian_shared_dependencies/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@aspect_bazel_lib//lib:tar.bzl", "tar")
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_distroless//apt:defs.bzl", "dpkg_status")
load("@rules_distroless//distroless:defs.bzl", "group", "passwd")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")

Expand Down Expand Up @@ -46,28 +45,6 @@ tar(
],
)

PACKAGES = [
"@shared_dependencies//tzdata",
"@shared_dependencies//bash",
"@shared_dependencies//coreutils",
"@shared_dependencies//nginx-core",
]

# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
)

oci_image(
name = "apt",
architecture = select({
Expand All @@ -79,17 +56,8 @@ oci_image(
":sh",
":passwd",
":group",
":dpkg_status",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
"@shared_dependencies//:shared_dependencies",
],
)

oci_load(
Expand Down
40 changes: 2 additions & 38 deletions examples/ubuntu_snapshot/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@aspect_bazel_lib//lib:tar.bzl", "tar")
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_distroless//apt:defs.bzl", "dpkg_status")
load("@rules_distroless//distroless:defs.bzl", "group", "passwd")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")

Expand Down Expand Up @@ -46,32 +45,6 @@ tar(
],
)

PACKAGES = [
"@noble//ncurses-base",
"@noble//libncurses6",
"@noble//tzdata",
"@noble//bash",
"@noble//coreutils",
"@noble//dpkg",
"@noble//apt",
"@noble//perl",
]

# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
)

oci_image(
name = "noble",
architecture = select({
Expand All @@ -83,17 +56,8 @@ oci_image(
":sh",
":passwd",
":group",
":dpkg_status",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
"@noble//:noble",
],
)

oci_load(
Expand Down

0 comments on commit 5c38a79

Please sign in to comment.