Add no cache for docker build#1384
Add no cache for docker build#1384creack merged 2 commits intomoby:masterfrom crosbymichael:1326-build-without-cache
Conversation
Add a new flag to disable the image cache when building images.
|
LGTM |
|
LGTM |
* Builder: Add no cache for docker build
|
<3 |
|
Trying to understand how caching works in general in docker. I understand -no-cache will disable caching for the entire Dockerfile. But how can I disable cache for a specific RUN command? For example updating repos or downloading a remote file .. etc. From my understanding that right now If it is possible to disable caching for specific commands in the Dockerfile, would the subsequent commands in the file then not use the cache? Or would they do something a bit more intelligent - e.g. use cache if the previous command result did not change even if didn't use the cache etc ? Can someone please explain? @crosbymichael ? Thanks, |
|
It's not possible to disable caching selectively atm. This is mostly because I can't think of a good way to select the layer to invalidate. Suggestions are welcome :) One thing you can do is remove the intermediary image used for caching - if you run "docker history" on your most recently built image, you'll see the image IDs corresponding to each build step. On Mon, Sep 23, 2013 at 11:09 AM, Mohan Raj Rajamanickam
|
|
Thanks @shykes |
Add a new flag to disable the image cache when building images.
Closes #1326