Skip to content

Instantly share code, notes, and snippets.

@tonistiigi
Created March 17, 2017 05:04
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 tonistiigi/775cb15d3918958020bdd0165f776005 to your computer and use it in GitHub Desktop.
Save tonistiigi/775cb15d3918958020bdd0165f776005 to your computer and use it in GitHub Desktop.
# cat <<EOT > Dockerfile
heredoc> from busybox
heredoc> copy foo /
heredoc> EOT
# echo "bar" > foo
# docker build .
Sending build context to Docker daemon 4.096 kB
Step 1/2 : FROM busybox
---> 7968321274dc
Step 2/2 : COPY foo /
---> 90c37559c514
Removing intermediate container f2ae96b9beb4
Successfully built 90c37559c514
# ln foo abc
# docker build .
Sending build context to Docker daemon 3.584 kB
Step 1/2 : FROM busybox
---> 7968321274dc
Step 2/2 : COPY foo / <<<<<<------------- NO CACHE
---> 063c39051fdc
Removing intermediate container 0b266d615123
Successfully built 063c39051fdc
# echo "new data" >> foo
# docker build .
Sending build context to Docker daemon 3.584 kB
Step 1/2 : FROM busybox
---> 7968321274dc
Step 2/2 : COPY foo /
---> Using cache <<<<<<------------- USING CACHE
---> 063c39051fdc
Successfully built 063c39051fdc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment