Skip to content

Commit

Permalink
Merge pull request #83 from dreyks/patch-1
Browse files Browse the repository at this point in the history
Mention cache-from in the readme
  • Loading branch information
lox authored Dec 18, 2017
2 parents 0810ce4 + 12f55e9 commit 6049092
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,25 @@ steps:
- app:index.docker.io/org/repo/myapp
- app:index.docker.io/org/repo/myapp:latest
```
## Reusing caches from images

A newly spawned agent won't contain any of the docker caches for the first run which will result in a long build step. To mitigate this you can reuse caches from a previously built image if it was pushed to the repo on a past run

```yaml
steps:
- name: ":docker Build an image"
plugins:
docker-compose#v1.7.0:
build: app
image-repository: index.docker.io/org/repo
cache-from: app:index.docker.io/org/repo/myapp:latest
- name: ":docker: Push to final repository"
plugins:
docker-compose#v1.7.0:
push:
- app:index.docker.io/org/repo/myapp
- app:index.docker.io/org/repo/myapp:latest
```

## Configuration

Expand Down Expand Up @@ -244,6 +262,10 @@ A number of times to retry failed docker push. Defaults to 0.

This option can also be configured on the agent machine using the environment variable `BUILDKITE_PLUGIN_DOCKER_COMPOSE_PUSH_RETRIES`.

### `cache-from` (optional)

A list of images to pull caches from in the format `service:index.docker.io/org/repo/image:tag`. Requires docker-compose file version `3.2+`. Currently only one image per service is supported. If there's no image present for a service local docker cache will be used.

## Developing

To run the tests:
Expand Down

0 comments on commit 6049092

Please sign in to comment.