Skip to content

Instantly share code, notes, and snippets.

@aanand
Last active January 2, 2016 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aanand/8318156 to your computer and use it in GitHub Desktop.
Save aanand/8318156 to your computer and use it in GitHub Desktop.
Dockerfile ADD caching bug
FROM ubuntu
ADD foo.txt /foo.txt
old content
$ docker version
Client version: 0.7.4
Go version (client): go1.2
Git commit (client): 010d74e
Server version: 0.7.4
Git commit (server): 010d74e
Go version (server): go1.2
Last stable version: 0.7.4
$ docker build -t cache-test .
Uploading context 10.24 kB
Uploading context
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : ADD foo.txt /foo.txt
---> 1506c7614be0
Successfully built 1506c7614be0
$ docker run cache-test cat /foo.txt
old content
$ echo "new content" > foo.txt
$ docker build -t cache-test .
Uploading context 10.24 kB
Uploading context
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : ADD foo.txt /foo.txt
---> Using cache
---> 1506c7614be0
Successfully built 1506c7614be0
$ docker run cache-test cat /foo.txt
old content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment