v0.8.0: Numerous Additions and Fixes
Breaking Changes
-
Return providers instead of struct from rule impl functions (#755)
IMPORTANT
This PR changes the return value type in some rule implementation functions fromstruct
to a list of providers.
No action is required if you are already using the providers returned by the below mentioned rules as described here (e.g.target[ProviderName].fieldName
).Your action may be required if you are using either the implementation function or any targets of the following rules (in your own rule implementation functions or macros):
container_bundle
(in container/bundle.bzl)container_image
(in container/image.bzl)container_import
(in container/import.bzl)filter_layer
(in lang/image.bzl)
Actions Required by Rule
container_bundle
If you use thecontainer_images
and/or thestamp
field of the returned struct, then get these fields from the returnedBundleInfo
provider as shown here.container_image
If you use thecontainer_parts
field of the returned struct, then get this field from the returnedImageInfo
provider as shown here.container_import
If you use thecontainer_parts
field of the returned struct, then get this field from the returnedImportInfo
provider (e.g.target[ImportInfo].container_parts
instead oftarget.container_parts
)filter_layer
If you use thepy
field of the returned struct astarget.py
, then get this field using the returnedPyInfo
provider astarget[PyInfo]
.
Note
If you access the returned providers with the following syntax:
target.providers[<index>].<field>
then you most likely need to change this to:
target[<index>].<field>
New Rules
- Repo rule to build an image from Dockerfile and save as tar (#737)
Features
- Support using Kaniko to build images. (#902)
- Add feature to pass --build-arg to dockerfile_image rule. (#828)
- Add support for host driver in container_test (#818)
- Allow passwd entry with non-existing home path (#757)
- nodejs_image: Allow passing in custom binary (#701)
- Publish an image.digest file for container_pull (#711)
- Containerregistry cached (#706)
- container_push: added attribute 'tag_file' (#691)
- expand make variables in env field (#670) (#672) (#678)
Dockerfile Examples
- Dockerfile vs java_image example (#797)
- Add Dockerfile example that handles an arbitrary RUN instruction (#796)
- Add dockerfile example that uses the RUN instruction (#750)
- Extended dockerfile example (#749)
- Basic Dockerfile vs container_image example (#740)
Documentation
- Update doc about new examples (#898)
- test use of incompatible_use_python_toolchains flag with Bazel 0.25.0 (#826)
- Go image doc update (#690) (#730)
- Add new adopters section for rules_docker (#687) (#688) (#692)
- Toolchain auth docs (#686)
- Update container_bundle and container_push doc to remark deprecation of "stamp" attribute (#674)
Fixes
- Add better error message when tar is used in container_test docker mode. (#905)
- Fix input that should be tool. (#900)
- Expose attributes from lang/image.bzl as struct (#876)
- Remove reference to cache which doesn't exist in internal codebase (#880)
- Fix incremental loader cleanup when no run statements are defined (#875)
- container_test verbose should drive verbosity (#864)
- Fix for Bazel upcoming change incompatible_string_join_requires_strings (#840)
- Mark Python binaries with explicit python_version. (#821)
- modify how stamp-info-file is calculated (#819)
- Add cleanup before docker run in incremental loader (#793)
legacy_run_behavior
value shouldn't be taken from base (#773) (#769)- Create empty workspace directory to fix using python deps as layers (#161) (#747)
- Fix Bazel incompatible issues (#716) (#712)
- Use internally downloaded six and disable legacy_create_init (#696)
- Set default_mtime=0 on TarFileWriter so that elements default to the epoch (#695)
- Split py_binary into py_binary and py_library to avoid having py_binary in deps (#677)
- go_image() now respects restricted_to and compatible_with (#669)
- Attempt to use
python2
first (#653) (#655) - Pipe through testonly to allow building tests as an image (#671) (#666)
- exec docker run statement (#667)
- Fix invalid container ref characters in names (#664)