Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README on running in Docker #1141

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,21 +260,24 @@ kaniko will build and push the final image in this build step.
Requirements:

- [Docker](https://docs.docker.com/install/)
- [gcloud](https://cloud.google.com/sdk/install)

We can run the kaniko executor image locally in a Docker daemon to build and push an image from a Dockerfile.

1. Load the executor image into the Docker daemon by running:

```shell
make images
```

2. Run kaniko in Docker using [`run_in_docker.sh`](./run_in_docker.sh):
For example, when using gcloud and GCR you could run Kaniko as follows:
```shell
docker run \
-v "$HOME"/.config/gcloud:/root/.config/gcloud \
-v /path/to/context:/workspace \
gcr.io/kaniko-project/executor:latest \
--dockerfile /workspace/Dockerfile
--destination "gcr.io/$PROJECT_ID/$IMAGE_NAME:$TAG"
--context dir:///workspace/"
```

```shell
./run_in_docker.sh <path to Dockerfile> <path to build context> <destination of final image>
```
There is also a utility script [`run_in_docker.sh`](./run_in_docker.sh) that can be used as follows:
```shell
./run_in_docker.sh <path to Dockerfile> <path to build context> <destination of final image>
```

_NOTE: `run_in_docker.sh` expects a path to a
Dockerfile relative to the absolute path of the build context._
Expand All @@ -284,7 +287,7 @@ context in the local directory `/home/user/kaniko-project`, and a Google Contain
as a remote image destination:

```shell
./run_in_docker.sh /workspace/Dockerfile /home/user/kaniko-project gcr.io//<project-id>/<tag>
./run_in_docker.sh /workspace/Dockerfile /home/user/kaniko-project gcr.io/$PROJECT_ID/$TAG
```

### Caching
Expand Down