*`build_args` - [build arguments](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables-build-arg) to pass to `docker build`
You may want to dynamically tag your image. Use the `$$BRANCH`, `$$COMMIT` and `$$BUILD_NUMBER` variables to tag your image with the branch, commit sha or build number:
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:
In some cases caching will greatly improve build performance, however, the tradeoff is that caching Docker image layers may consume very large amounts of disk space.
For detailed output you can set the `DOCKER_LAUNCH_DEBUG` environment variable in your plugin configuration. This starts Docker with verbose logging enabled.
There are known issues when attempting to run this plugin on CentOS, RedHat, and Linux installations that do not have a supported storage driver installed. You can check by running `docker info | grep 'Storage Driver:'` on your host machine. If the storage driver is not `aufs` or `overlay` you will need to re-configure your host machine.
This error occurs when trying to use the default `aufs` storage Driver but aufs is not installed:
```
level=fatal msg="Error starting daemon: error initializing graphdriver: driver not supported
```
This error occurs when trying to use the `overlay` storage Driver but overlay is not installed:
```
level=error msg="'overlay' not found as a supported filesystem on this host.
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
```
The above issue can be resolved by setting `storage_driver: vfs` in the `.drone.yml` file. This may work, but will have very poor performance as discussed [here](https://github.com/rancher/docker-from-scratch/issues/20).