Created
December 29, 2020 13:54
-
-
Save dlorenc/247222f619d78d070d574c7f1fd7d688 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First try, we get edb8f4a65586 as our hash | |
$ cat << EOF | docker build --no-cache - | |
> FROM alpine | |
> RUN touch foo | |
> EOF | |
Sending build context to Docker daemon 2.048kB | |
Step 1/2 : FROM alpine | |
---> a24bb4013296 | |
Step 2/2 : RUN touch foo | |
---> Running in 9687f21f4edb | |
Removing intermediate container 9687f21f4edb | |
---> edb8f4a65586 | |
Successfully built edb8f4a65586 | |
# Do it again! We get a different hash: 9617b400b61e | |
$ cat << EOF | docker build --no-cache - | |
> FROM alpine | |
> RUN touch foo | |
> EOF | |
Sending build context to Docker daemon 2.048kB | |
Step 1/2 : FROM alpine | |
---> a24bb4013296 | |
Step 2/2 : RUN touch foo | |
---> Running in 36d808046160 | |
Removing intermediate container 36d808046160 | |
---> 9617b400b61e | |
Successfully built 9617b400b61e | |
# Now drop the --no-cache flag and we get the same hash! | |
$ cat << EOF | docker build - | |
> FROM alpine | |
> RUN touch foo | |
> EOF | |
Sending build context to Docker daemon 2.048kB | |
Step 1/2 : FROM alpine | |
---> a24bb4013296 | |
Step 2/2 : RUN touch foo | |
---> Using cache | |
---> 9617b400b61e | |
Successfully built 9617b400b61e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment