diff --git a/oci_go_image/.bazelversion b/oci_go_image/.bazelversion index dfda3e0b..815da58b 100644 --- a/oci_go_image/.bazelversion +++ b/oci_go_image/.bazelversion @@ -1 +1 @@ -6.1.0 +7.4.1 diff --git a/oci_go_image/BUILD.bazel b/oci_go_image/BUILD.bazel index 988b58fc..41d525cb 100644 --- a/oci_go_image/BUILD.bazel +++ b/oci_go_image/BUILD.bazel @@ -2,7 +2,7 @@ load("@aspect_bazel_lib//lib:testing.bzl", "assert_archive_contains") load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@container_structure_test//:defs.bzl", "container_structure_test") load("@rules_go//go:def.bzl", "go_binary", "go_library") -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") load("@rules_pkg//:pkg.bzl", "pkg_tar") go_library( @@ -51,24 +51,23 @@ platform_transition_filegroup( }), ) -# $ bazel build :tarball -# $ docker load --input $(bazel cquery --output=files :tarball) +# $ bazel run :load # $ docker run --rm gcr.io/example:latest # string( # - "Hello World", # + "Hello Go", # ) -oci_tarball( - name = "tarball", - # Use the image built for the exec platform rather than the target platform - image = ":image", +oci_load( + name = "load", + # Use the image built for the target platform + image = ":transitioned_image", repo_tags = ["gcr.io/example:latest"], ) container_structure_test( name = "test", configs = ["test.yaml"], - # Use the image built for the exec platform rather than the target platform - image = ":image", + # Use the image built for the target platform as it runs through docker + image = ":transitioned_image", tags = ["requires-docker"], ) diff --git a/oci_go_image/MODULE.bazel b/oci_go_image/MODULE.bazel index 9c0bafab..4db49684 100644 --- a/oci_go_image/MODULE.bazel +++ b/oci_go_image/MODULE.bazel @@ -1,23 +1,20 @@ -bazel_dep(name = "aspect_bazel_lib", version = "1.31.1") -bazel_dep(name = "container_structure_test", version = "1.15.0") -bazel_dep(name = "gazelle", version = "0.31.0") -bazel_dep(name = "platforms", version = "0.0.5") -bazel_dep(name = "rules_oci", version = "1.2.0") -bazel_dep(name = "rules_pkg", version = "0.8.1") -bazel_dep(name = "rules_go", version = "0.39.1") +bazel_dep(name = "aspect_bazel_lib", version = "2.9.4") +bazel_dep(name = "container_structure_test", version = "1.19.1") +bazel_dep(name = "gazelle", version = "0.40.0") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_oci", version = "2.0.1") +bazel_dep(name = "rules_pkg", version = "1.0.1") +bazel_dep(name = "rules_go", version = "0.50.1") go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") - go_deps.module( path = "github.com/google/go-cmp", sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=", version = "v0.5.9", ) - use_repo(go_deps, "com_github_google_go_cmp") oci = use_extension("@rules_oci//oci:extensions.bzl", "oci") - oci.pull( name = "distroless_base", digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86", @@ -27,5 +24,4 @@ oci.pull( "linux/arm64", ], ) - use_repo(oci, "distroless_base")