Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Adding files using addFile invalidates the docker cache #26

Open skullmaggots opened 10 years ago

skullmaggots commented 10 years ago

When you add a file using addFile() the plugin always copies this file across during the preparation of the staging area. However on an incremental gradle build the file might not have changed, but you will get a new file created with a newer date/time. Therefore during the build docker creates a new layer for this step.

Once this happens all layers after this added file will also not use the cache. The causes some very slow builds and is real pain, especially given the extent to which I'm using docker.

Is it possible to not copy the file across to the staging area if it hasn't changed?

This would massively improve build times.

Note:- I'm using the native docker client not the REST api.