Skip to content

Commit

Permalink
chore: smoke test includes a pull (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Aug 16, 2023
1 parent 0f7297c commit 9058e7a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
6 changes: 1 addition & 5 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ load("@container_structure_test//:defs.bzl", "container_structure_test")

oci_image(
name = "image",
architecture = select({
"@platforms//cpu:arm64": "arm64",
"@platforms//cpu:x86_64": "amd64",
}),
base = "@distroless_base",
cmd = [
"--arg1",
"--arg2",
Expand All @@ -17,7 +14,6 @@ oci_image(
env = {
"ENV": "/test",
},
os = "linux",
)

tags = [
Expand Down
14 changes: 14 additions & 0 deletions e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ local_path_override(
module_name = "rules_oci",
path = "../..",
)

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)

use_repo(oci, "distroless_base")
13 changes: 13 additions & 0 deletions e2e/smoke/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@ oci_register_toolchains(
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)

# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")

oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)

0 comments on commit 9058e7a

Please sign in to comment.