Using Bzlmod
Add the following to your MODULE.bazel file:
bazel_dep(name = "rules_img", version = "0.3.4")For further instructions, see the README.
Using WORKSPACE
Add the following to your WORKSPACE.bazel file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_img",
sha256 = "a58f553caa5ab2d807ea2ee80f552e8d0668036922d8a66ace152d717b3b5e09",
urls = ["https://github.com/bazel-contrib/rules_img/releases/download/v0.3.4/rules_img-v0.3.4.tar.gz"],
)
# Load dependencies
load("@rules_img//img:dependencies.bzl", "rules_img_dependencies")
rules_img_dependencies()
# Register prebuilt toolchains
load("@rules_img//img:repositories.bzl", "img_register_prebuilt_toolchains", "pull_tool_register_prebuilt_repositories")
img_register_prebuilt_toolchains()
register_toolchains("@img_toolchain//:all")
# Register prebuilt pull_tool repositories (for pull functionality)
pull_tool_register_prebuilt_repositories()
# Example: Pull a base image
load("@rules_img//img:pull.bzl", "pull")
pull(
name = "alpine",
digest = "sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1",
registry = "index.docker.io",
repository = "library/alpine",
tag = "3.22",
)For more examples, see the README.
What's Changed
- Nix: make dev shell build on macOS by @malt3 in #365
- image_layer: speed up calculation of hashes when processing existing tar by @malt3 in #366
- Fixes image manifest for arm64 images without variant by @alexnovak in #361
- Clear Cmd when setting Entrypoint to match Docker/OCI behavior by @malt3 in #372
- update hermetic_launcher to 0.0.4 by @malt3 in #383
- cleanup go.sum by @malt3 in #389
- Support username:password in gRPC URL for remote_cache by @malt3 in #385
- improve PullInfo selection in image_index for multi-base scenarios by @malt3 in #390
- manifest_from_oci_layout: allow "arm" architecture by @malt3 in #391
- update BCR deps by @malt3 in #392
- Fix handling of source directories in image_layer by @malt3 in #371
- Bazel 8.x: test against 8.5.1 by @malt3 in #386
- prepare 0.3.4 by @malt3 in #401
New Contributors
- @alexnovak made their first contribution in #361
Full Changelog: v0.3.3...v0.3.4