mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 10:10:39 +00:00
Use /drone/docker for the Docker daemon's graph directory
This allows caching the whole Docker graph with the cache plugin. (Caching works efficiently with the overlay storage driver at least. Probably shouldn't be used with other storage drivers.)
This commit is contained in:
parent
0986b5dfe0
commit
4023d44674
30
DOCS.md
30
DOCS.md
@ -78,9 +78,35 @@ publish:
|
|||||||
- HTTP_PROXY=http://yourproxy.com
|
- HTTP_PROXY=http://yourproxy.com
|
||||||
```
|
```
|
||||||
|
|
||||||
## Layer Caching
|
## Caching
|
||||||
|
|
||||||
The Drone build environment is, by default, ephemeral meaning that you layers are not saved between builds. The below example combines Drone's caching feature and Docker's `save` and `load` capabilities to cache and restore image layers between builds:
|
The Drone build environment is, by default, ephemeral meaning that you layers are not saved between builds. There are two methods for caching layers.
|
||||||
|
|
||||||
|
### Graph directory caching
|
||||||
|
|
||||||
|
This is the preferred method when using the `overlay` storage driver. Just use Drone's caching feature to backup and restore the directory `/drone/docker`, as shown in the following example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
publish:
|
||||||
|
docker:
|
||||||
|
username: kevinbacon
|
||||||
|
password: pa55word
|
||||||
|
email: kevin.bacon@mail.com
|
||||||
|
repo: foo/bar
|
||||||
|
tag:
|
||||||
|
- latest
|
||||||
|
- "1.0.1"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
mount:
|
||||||
|
- /drone/docker
|
||||||
|
```
|
||||||
|
|
||||||
|
NOTE: This probably won't work correctly with the `btrfs` driver, and it will be very inefficient with the `devicemapper` driver. Please make sure to use the `overlay` storage driver with this method.
|
||||||
|
|
||||||
|
### Layer Caching
|
||||||
|
|
||||||
|
The below example combines Drone's caching feature and Docker's `save` and `load` capabilities to cache and restore image layers between builds:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
publish:
|
publish:
|
||||||
|
Loading…
Reference in New Issue
Block a user