Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 3b5d2b7

Browse files
authored
Update README to account for new tar build output (bazelbuild#2123)
* Update README to account for new tar build output The tar output location has been changed and is no longer stable. The old docs were not updated at the time of the change and the result is confusing build breakages. Until the original behavior is added back (not clear that it will happen) the README should document the new behavior. See Issue bazelbuild#2014 for more info (this was closed as WAI), and [GoogleContainerTools PR#7251](GoogleContainerTools/skaffold#7251) for more context. * Update README.md add ".tar" to the query, it is needed!
1 parent ed321b3 commit 3b5d2b7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,22 @@ performs the following steps:
245245
You can suppress this behavior by passing the single flag: `bazel run :foo -- --norun`
246246

247247
Alternatively, you can build a `docker load` compatible bundle with:
248-
`bazel build my/image:helloworld.tar`. This will produce the file:
249-
`bazel-bin/my/image/helloworld.tar`, which you can load into
250-
your local Docker client by running:
251-
`docker load -i bazel-bin/my/image/helloworld.tar`. Building
252-
this target can be expensive for large images.
248+
`bazel build my/image:helloworld.tar`. This will produce a tar file
249+
in your `bazel-out` directory that can be loaded into your local Docker
250+
client. Building this target can be expensive for large images. You will
251+
first need to query the ouput file location.
252+
253+
```bash
254+
TARBALL_LOCATION=$(bazel cquery my/image:helloworld.tar \
255+
--output starlark \
256+
--starlark:expr="target.files.to_list()[0].path")
257+
docker load -i $TARBALL_LOCATION
258+
```
253259

254260
These work with both `container_image`, `container_bundle`, and the
255-
`lang_image` rules. For everything except
256-
`container_bundle`, the image name will be `bazel/my/image:helloworld`.
257-
For `container_bundle`, it will apply the tags you have specified.
261+
`lang_image` rules. For everything except `container_bundle`, the image
262+
name will be `bazel/my/image:helloworld`. The `container_bundle` rule will
263+
apply the tags you have specified.
258264

259265
## Authentication
260266

0 commit comments

Comments
 (0)