aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/docker/docker.bzl
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-10-01 17:07:08 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-10-01 19:44:40 +0000
commitf345d0806eb7b7458c1988a6eeab822944ce5c71 (patch)
tree4fa97f4e0c4c88c22575a4757453bc6c7f6821a8 /tools/build_defs/docker/docker.bzl
parent5943bfb8d15bfb14c747204c36f7c8f7a6672180 (diff)
[Docker] add a `repository` attribute
This attribute specifies the default repository for the generated image. -- MOS_MIGRATED_REVID=104408398
Diffstat (limited to 'tools/build_defs/docker/docker.bzl')
-rw-r--r--tools/build_defs/docker/docker.bzl11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/build_defs/docker/docker.bzl b/tools/build_defs/docker/docker.bzl
index 1f818b032c..67e17e0761 100644
--- a/tools/build_defs/docker/docker.bzl
+++ b/tools/build_defs/docker/docker.bzl
@@ -197,11 +197,9 @@ def _create_image(ctx, layer, name, metadata):
"--layer=" + layer.path,
"--id=@" + name.path,
# We label at push time, so we only put a single name in this file:
- # bazel/package:target => {the layer being appended}
- # TODO(dmarting): Does the name makes sense? We could use the
- # repositoryName/package instead. (why do we need to replace
- # slashes?)
- "--repository=bazel/" + ctx.label.package.replace("/", "_"),
+ # repository/package:target => {the layer being appended}
+ "--repository=%s/%s" % (ctx.attr.repository,
+ ctx.label.package.replace("/", "_")),
"--name=" + ctx.label.name
]
inputs = [layer, metadata, name]
@@ -251,6 +249,7 @@ docker_build_ = rule(
"ports": attr.string_list(), # Skylark doesn't support int_list...
"volumes": attr.string_list(),
"workdir": attr.string(),
+ "repository": attr.string(default="bazel"),
# Implicit dependencies.
"_build_layer": attr.label(
default=Label("//tools/build_defs/docker:build_layer"),
@@ -373,7 +372,7 @@ def docker_build(**kwargs):
This rule appends a single new layer to the tarball of this form provided
via the 'base' parameter.
- The images produced by this rule are always named 'blaze/tmp:latest' when
+ The images produced by this rule are always named 'bazel/tmp:latest' when
loaded (an internal detail). The expectation is that the images produced
by these rules will be uploaded using the 'docker_push' rule below.