Various updates & fixes
Copy the following into your WORKSPACE file to use rules_docker at release v0.22.0
http_archive(
name = "io_bazel_rules_docker",
sha256 = "59536e6ae64359b716ba9c46c39183403b01eabfbd57578e84398b4829ca499a",
strip_prefix = "rules_docker-0.22.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.22.0/rules_docker-v0.22.0.tar.gz"],
)
BREAKING CHANGES
Previous releases of rules_docker determined when to make non-deterministic, VCS-stamped outputs based on whether a {
character appeared in certain attributes. Some rules had a (deprecated) stamp
boolean attribute which affected this behavior all builds of that target. This makes it easy to accidentally bust the Bazel cache, for example a test that depends on a container_image
might re-run every time because the image's tag changed with each git SHA.
As of this release, you should run bazel build --stamp
enable stamped outputs.
To override this on a single target, the stamp
attribute on these three rules is now a trinary, just like in other rulesets like rules_python
- in place of
stamp = False
you should usestamp = "@io_bazel_rules_docker//stamp:never"
- in place of
stamp = True
you should usestamp = "@io_bazel_rules_docker//stamp:always"
- if no value for
stamp
attribute is given, the default is based on the--[no]stamp
configuration of the build.
For more ideas on using this, see the blog post by the author of the stamping PR: https://blog.aspect.dev/stamping-bazel-builds-with-selective-delivery
What's Changed
- feat: add timeout attribute to container_pull by @alexeagle in #1960
- Add target as an attribute to dockerfile_build by @jakegut in #1944
- Add digests of the images being used for examples by @tetsuok in #1964
- fix: add label to tar warning message by @mattem in #1967
- Base stamping decisions on --stamp configuration, not attributes on t… by @alexeagle in #1878
- container_push: add skip_unchanged_digest attribute by @sluongng in #1744
- Don't print output of ExtractImageId mnemonics when successful by @alexeagle in #1969
- update distroless images by @dattto in #1971
- container_load: use cfg="exec" instead of cfg="host" by @Yannic in #1976
- container/bundle.bzl: improve bundle rules doc by @sluongng in #1975
- Add generated comment in generated file by @alexeagle in #1894
- Add tool target attribute to docker toolchain by @moshe in #1946
- toolchain: allow to configure build_tar target by @dataoleg in #1937
New Contributors
- @jakegut made their first contribution in #1944
- @tetsuok made their first contribution in #1964
- @mattem made their first contribution in #1967
- @sluongng made their first contribution in #1744
- @dattto made their first contribution in #1971
- @Yannic made their first contribution in #1976
- @moshe made their first contribution in #1946
- @dataoleg made their first contribution in #1937
Full Changelog: v0.21.0...v0.22.0