v2.0.0-beta2
·
29 commits
to main
since this release
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "2.0.0-beta2")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "311e78803a4161688cc79679c0fb95c56445a893868320a3caf174ff6e2c383b",
strip_prefix = "rules_oci-2.0.0-beta2",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.0-beta2/rules_oci-v2.0.0-beta2.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains")
oci_register_toolchains(name = "oci")
# 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",
],
)
What's Changed
- fix: support external oci_image targets by @thesayyn in #622
- fix: reset cmd when entrypoint is set by @thesayyn in #656
- fix: set created property for scratch base by @thesayyn in #655
- Mention ociupdate in the README by @mark-thm in #660
- fix: add history entries for tars attribute by @thesayyn in #654
- fix typo in load.sh.tpl by @kopp in #657
- test: add test for setting entrypoint to [] by @thesayyn in #662
- fix: comma in entrypoint and cmd by @thesayyn in #663
- fix: ensures confugure_buildx rule runs when bazel server restarts by @kvet in #670
New Contributors
Full Changelog: v2.0.0-beta1...v2.0.0-beta2