You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: container/pull.bzl
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ construct new images.
22
22
NOTE: `container_pull` now supports authentication using custom docker client configuration.
23
23
See [here](https://github.com/bazelbuild/rules_docker#container_pull-custom-client-configuration) for details.
24
24
25
-
NOTE: Set `PULLER_TIMEOUT` env variable to change the default 600s timeout.
25
+
NOTE: Set `PULLER_TIMEOUT` env variable to change the default 600s timeout for all container_pull targets.
26
26
27
27
NOTE: Set `DOCKER_REPO_CACHE` env variable to make the container puller cache downloaded layers at the directory specified as a value to this env variable.
28
28
The caching feature hasn't been thoroughly tested and may be thread unsafe.
@@ -123,6 +123,11 @@ _container_pull_attrs = {
123
123
Note: For reproducible builds, use of `digest` is recommended.
124
124
""",
125
125
),
126
+
"timeout": attr.int(
127
+
doc="""Timeout in seconds to fetch the image from the registry.
128
+
129
+
This attribute will be overridden by the PULLER_TIMEOUT environment variable, if it is set.""",
130
+
),
126
131
}
127
132
128
133
def_impl(repository_ctx):
@@ -210,6 +215,9 @@ def _impl(repository_ctx):
210
215
kwargs["timeout"] =int(timeout_in_secs)
211
216
else:
212
217
fail("'%s' is invalid value for PULLER_TIMEOUT. Must be an integer."% (timeout_in_secs))
A repository rule that pulls down a Docker base image in a manner suitable for use with the `base` attribute of `container_image`.
@@ -165,7 +166,7 @@ construct new images.
165
166
NOTE: `container_pull` now supports authentication using custom docker client configuration.
166
167
See [here](https://github.com/bazelbuild/rules_docker#container_pull-custom-client-configuration) for details.
167
168
168
-
NOTE: Set `PULLER_TIMEOUT` env variable to change the default 600s timeout.
169
+
NOTE: Set `PULLER_TIMEOUT` env variable to change the default 600s timeout for all container_pull targets.
169
170
170
171
NOTE: Set `DOCKER_REPO_CACHE` env variable to make the container puller cache downloaded layers at the directory specified as a value to this env variable.
171
172
The caching feature hasn't been thoroughly tested and may be thread unsafe.
@@ -200,6 +201,7 @@ please use the bazel startup flag `--loading_phase_threads=1` in your bazel invo
200
201
| <aid="container_pull-repo_mapping"></a>repo_mapping | A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry <code>"@foo": "@bar"</code> declares that, for any time this repository depends on <code>@foo</code> (such as a dependency on <code>@foo//some:target</code>, it should actually resolve that dependency within globally-declared <code>@bar</code> (<code>@bar//some:target</code>). | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | required ||
201
202
| <aid="container_pull-repository"></a>repository | The name of the image. | String | required ||
202
203
| <aid="container_pull-tag"></a>tag | The <code>tag</code> of the Docker image to pull from the specified <code>repository</code>.<br><br> If neither this nor <code>digest</code> is specified, this attribute defaults to <code>latest</code>. If both are specified, then <code>tag</code> is ignored.<br><br> Note: For reproducible builds, use of <code>digest</code> is recommended. | String | optional | "latest" |
204
+
| <aid="container_pull-timeout"></a>timeout | Timeout in seconds to fetch the image from the registry.<br><br> This attribute will be overridden by the PULLER_TIMEOUT environment variable, if it is set. | Integer | optional | 0 |
0 commit comments