# Docker support for Bazel
Implicit output targets | |
---|---|
name.tar |
The full Docker image
A full Docker image containing all the layers, identical to
what |
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 `data_path` is removed from the directory structure. This path can be absolute from the workspace root if starting with a `/` or relative to the rule's directory. A relative path may starts with "./" (or be ".") but cannot use go up with "..". By default, the `data_path` attribute is unused and all files are supposed to have no prefix. |
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. |
mode |
String, default to 0555
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 package to install. A list of debian packages that will be installed in the docker image. |
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). |
entrypoint |
String or string list, optional
|
cmd |
String or string list, optional
|
env |
Dictionary from strings to strings, optional
Dictionary from environment variable names to their values when running the docker image.
|
labels |
Dictionary from strings to strings, optional
|
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). |
repository |
String, default to `bazel`
The repository for the default tag for the image. Image generated by `docker_build` are tagged by default to `bazel/package_name:target` for a `docker_build` target at `//package/name:target`. Setting this attribute to `gcr.io/dummy` would set the default tag to `gcr.io/dummy/package_name:target`. |