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 10, 2024
1 parent b0c52c1 commit 860dd9c
Showing 1 changed file with 2 additions and 38 deletions.
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 860dd9c

Please sign in to comment.