Skip to content

Commit

Permalink
Update README to account for new tar build output (#2123)
Browse files Browse the repository at this point in the history
* 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 #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!
  • Loading branch information
eap authored Jul 7, 2022
1 parent ed321b3 commit 3b5d2b7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,22 @@ performs the following steps:
You can suppress this behavior by passing the single flag: `bazel run :foo -- --norun`

Alternatively, you can build a `docker load` compatible bundle with:
`bazel build my/image:helloworld.tar`. This will produce the file:
`bazel-bin/my/image/helloworld.tar`, which you can load into
your local Docker client by running:
`docker load -i bazel-bin/my/image/helloworld.tar`. Building
this target can be expensive for large images.
`bazel build my/image:helloworld.tar`. This will produce a tar file
in your `bazel-out` directory that can be loaded into your local Docker
client. Building this target can be expensive for large images. You will
first need to query the ouput file location.

```bash
TARBALL_LOCATION=$(bazel cquery my/image:helloworld.tar \
--output starlark \
--starlark:expr="target.files.to_list()[0].path")
docker load -i $TARBALL_LOCATION
```

These work with both `container_image`, `container_bundle`, and the
`lang_image` rules. For everything except
`container_bundle`, the image name will be `bazel/my/image:helloworld`.
For `container_bundle`, it will apply the tags you have specified.
`lang_image` rules. For everything except `container_bundle`, the image
name will be `bazel/my/image:helloworld`. The `container_bundle` rule will
apply the tags you have specified.

## Authentication

Expand Down

0 comments on commit 3b5d2b7

Please sign in to comment.