| Attributes | |
|---|---|
name |
Unique name for this repository rule. |
registry |
The registry from which to pull the base image. |
repository |
The `repository` of images to pull from. |
digest |
The `digest` of the Docker image to pull from the specified `repository`. Note: For reproducible builds, use of `digest` is recommended. |
tag |
The `tag` of the Docker image to pull from the specified `repository`. If neither this nor `digest` is specified, this attribute defaults to `latest`. If both are specified, then `tag` is ignored. Note: For reproducible builds, use of `digest` is recommended. |
os |
When the specified image refers to a multi-platform
manifest list, the desired operating system. For example,
|
os_version |
When the specified image refers to a multi-platform
manifest list, the desired operating system version. For example,
|
os_features |
When the specified image refers to a multi-platform
manifest list, the desired operating system features. For example,
on Windows this might be |
architecture |
When the specified image refers to a multi-platform
manifest list, the desired CPU architecture. For example,
|
cpu_variant |
When the specified image refers to a multi-platform
manifest list, the desired CPU variant. For example, for ARM you
may need to use |
platform_features |
When the specified image refers to a multi-platform
manifest list, the desired features. For example, this may
include CPU features such as |
puller_darwin |
A Mac 64-bit binary that implements the functionality provided by
|
puller_linux |
A Linux 64-bit binary that implements the functionality provided by
|
docker_client_config |
Specifies the directory to look for the docker client configuration. Don't use this directly.
Specify the docker configuration directory using a custom docker toolchain configuration. Look
for the When left unspecified (ie not set explicitly or set by the docker toolchain), docker will use the directory specified via the DOCKER_CONFIG environment variable. If DOCKER_CONFIG isn't set, docker falls back to $HOME/.docker. |
| Attributes | |
|---|---|
name |
Unique name for this rule. |
format |
The desired format of the published image. Currently, this supports
|
image |
The label containing a Docker image to publish. |
registry |
The registry to which to publish the image. This field supports stamp variables. |
repository |
The `repository` of images to which to push. This field supports stamp variables. |
tag |
The `tag` of the Docker image to push to the specified `repository`. This attribute defaults to `latest`. This field supports stamp variables. |
stamp |
Deprecated: it is now automatically inferred. If true, enable use of workspace status variables
(e.g. These fields are specified in the tag using Python format
syntax, e.g.
|
| Implicit output targets | |
|---|---|
name-layer.tar |
A tarball of current layer
A data tarball corresponding to the layer. |
| Attributes | |
|---|---|
name |
Name, required
A unique name for this rule. |
data_path |
String, optional
Root path of the files.
The directory structure from the files is preserved inside the
Docker image, but a prefix path determined by |
directory |
String, optional
Target directory. The directory in which to expand the specified files, defaulting to '/'. Only makes sense accompanying one of files/tars/debs. |
empty_dirs |
List of directories, optional
Directory to add to the layer. A list of empty directories that should be created in the Docker image. |
files |
List of files, optional
File to add to the layer. A list of files that should be included in the Docker image. |
mode |
String, default to 0o555
Set the mode of files added by the |
tars |
List of files, optional
Tar file to extract in the layer. A list of tar files whose content should be in the Docker image. |
debs |
List of files, optional
Debian packages to extract.
Deprecated: A list of debian packages that will be extracted in the Docker image.
Note that this doesn't actually install the packages. Installation needs apt
or apt-get which need to be executed within a running container which
|
symlinks |
Dictionary, optional
Symlinks to create in the Docker image.
|
env |
Dictionary from strings to strings, optional
Dictionary from environment variable names to their values when running the Docker image.
The values of this field support make variables (e.g., |
compression |
String, optional
Compression method for image layers. Currently only This affects the compressed layer, which is by the `container_push` rule.
|
compression_options |
List of strings, optional
Command-line options for the compression tool. Possible values depend on `compression` method. This affects the compressed layer, which is by the `container_push` rule.
|
| Implicit output targets | |
|---|---|
name.tar |
The full Docker image
A full Docker image containing all the layers, identical to
what |
name.digest |
The full Docker image's digest
An image digest that can be used to refer to that image. Unlike tags, digest references are immutable i.e. always refer to the same content. |
name-layer.tar |
An image of the current layer
A Docker image containing only the layer corresponding to that target. It is used for incremental loading of the layer. Note: this target is not suitable for direct consumption. It is used for incremental loading and non-docker rules should depends on the Docker image (name.tar) instead. |
name |
Incremental image loader
The incremental image loader. It will load only changed layers inside the Docker registry. |
| Attributes | |
|---|---|
name |
Name, required
A unique name for this rule. |
base |
File, optional
The base layers on top of which to overlay this layer, equivalent to FROM. |
data_path |
String, optional
Root path of the files.
The directory structure from the files is preserved inside the
Docker image, but a prefix path determined by |
directory |
String, optional
Target directory. The directory in which to expand the specified files, defaulting to '/'. Only makes sense accompanying one of files/tars/debs. |
files |
List of files, optional
File to add to the layer. A list of files that should be included in the Docker image. |
legacy_repository_naming |
Bool, default to False
Whether to use the legacy strategy for setting the repository name
embedded in the resulting tarball.
e.g. |
mode |
String, default to 0o555
Set the mode of files added by the |
tars |
List of files, optional
Tar file to extract in the layer. A list of tar files whose content should be in the Docker image. |
debs |
List of files, optional
Debian packages to extract.
Deprecated: A list of debian packages that will be extracted in the Docker image.
Note that this doesn't actually install the packages. Installation needs apt
or apt-get which need to be executed within a running container which
|
symlinks |
Dictionary, optional
Symlinks to create in the Docker image.
|
user |
String, optional
The user that the image should run as. Because building the image never happens inside a Docker container, this user does not affect the other actions (e.g., adding files). This field supports stamp variables. |
entrypoint |
String or string list, optional
List of entrypoints to add in the image.
The behavior between using
Set This field supports stamp variables. |
cmd |
String or string list, optional
List of commands to execute in the image.
The behavior between using
Set This field supports stamp variables. |
creation_time |
String, optional, default to {BUILD_TIMESTAMP} when stamp = True, otherwise 0
The image's creation timestamp. Acceptable formats: Integer or floating point seconds since Unix Epoch, RFC 3339 date/time. This field supports stamp variables. |
env |
Dictionary from strings to strings, optional
Dictionary from environment variable names to their values when running the Docker image.
The values of this field support make variables (e.g., |
labels |
Dictionary from strings to strings, optional
The values of this field support stamp variables. |
ports |
String list, optional
|
volumes |
String list, optional
|
workdir |
String, optional
Initial working directory when running the Docker image. Because building the image never happens inside a Docker container, this working directory does not affect the other actions (e.g., adding files). This field supports stamp variables. |
layers |
Label list, optional
List of The data from each |
repository |
String, default to `bazel`
The repository for the default tag for the image. Images generated by |
stamp |
If true, enable use of workspace status variables
(e.g. These fields are specified in attributes using Python format
syntax, e.g. |
launcher |
If present, prefix the image's ENTRYPOINT with this file. Note that the launcher should be a container-compatible (OS & Arch) single executable file without any runtime dependencies (as none of its runfiles will be included in the image). |
launcher_args |
Optional arguments for the |
legacy_run_behavior |
If set to False, Note that it defaults to |
docker_run_flags |
Optional flags to use with Only used when |
architecture |
The desired CPU architecture to be used as label in the container image. |
os_version |
The desired OS version to be used in the container image config. |
compression |
String, optional
Compression method for image layer. Currently only This affects the compressed layer, which is by the `container_push` rule. It doesn't affect the layers specified by the `layers` attribute.
|
compression_options |
List of strings, optional
Command-line options for the compression tool. Possible values depend on `compression` method. This affects the compressed layer, which is used by the `container_push` rule. It doesn't affect the layers specified by the `layers` attribute.
|
| Toolchains | |
|---|---|
@io_bazel_rules_docker//toolchains/docker:toolchain_type |
See How to use the Docker Toolchain for details |
| Attributes | |
|---|---|
name |
Unique name for this rule. |
images |
A collection of the images to save into the tarball. The keys are the tags with which to alias the image specified by the
value. These tags may contain make variables ( The values may be the output of |
stamp |
Deprecated: it is now automatically inferred. If true, enable use of workspace status variables
(e.g. These fields are specified in the tag using Python format
syntax, e.g.
|
| Attributes | |
|---|---|
name |
Unique name for this rule. |
config |
A json configuration file containing the image's metadata. This appears in `docker save` tarballs as ` |
layers |
The list of layer |
| Attributes | |
|---|---|
name |
Unique name for this rule. |
file |
A label targeting a single file which is a compressed or uncompressed tar, as obtained through `docker save IMAGE`. |