You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM python:3.6.5
RUN echo "START"
RUN mkdir /test
ADD a /test
RUN echo "AHA"
Run docker build --cache-from shivawu/test-cache-from .
Run 2 again
Describe the results you received:
[ec2-user@ip-192-0-0-151 test]$ docker build --pull -t shivawu/test-cache-from:test6 --cache-from shivawu/test-cache-from:test5 .
Sending build context to Docker daemon 2.56 kB
Step 1/6 : FROM python:3.6.5
3.6.5: Pulling from library/python
Digest: sha256:ed978c29213ab3360766d2f42a898d5faa60e27294f142ba58c6c3617896a52b
Status: Image is up to date for python:3.6.5
---> efb6baa1169f
Step 2/6 : RUN apt-get update && apt-get install -y vim
---> Using cache
---> ea40cb37d9bf
Step 3/6 : RUN echo "START"
---> Using cache
---> 5f18a85fd606
Step 4/6 : RUN mkdir /test
---> Using cache
---> 1451f6ff4b55
Step 5/6 : ADD a /test
---> 5ca8fec6c97f
Removing intermediate container 8bd9a93a1edf
Step 6/6 : RUN echo "AHA"
---> Running in cd6a87a7c1c8
AHA
---> cd286d325aca
Removing intermediate container cd6a87a7c1c8
Successfully built cd286d325aca
[ec2-user@ip-192-0-0-151 test]$ docker build --pull -t shivawu/test-cache-from:test6 --cache-from shivawu/test-cache-from:test5 .
Sending build context to Docker daemon 2.56 kB
Step 1/6 : FROM python:3.6.5
3.6.5: Pulling from library/python
Digest: sha256:ed978c29213ab3360766d2f42a898d5faa60e27294f142ba58c6c3617896a52b
Status: Image is up to date for python:3.6.5
---> efb6baa1169f
Step 2/6 : RUN apt-get update && apt-get install -y vim
---> Using cache
---> ea40cb37d9bf
Step 3/6 : RUN echo "START"
---> Using cache
---> 5f18a85fd606
Step 4/6 : RUN mkdir /test
---> Using cache
---> 1451f6ff4b55
Step 5/6 : ADD a /test
---> 85441a2840a8
Removing intermediate container 3805300332bc
Step 6/6 : RUN echo "AHA"
---> Running in e0c8bbfed714
AHA
---> 6e496426a963
Removing intermediate container e0c8bbfed714
Successfully built 6e496426a963
Describe the results you expected:
As you can see, the two run of docker build diverge from step 5, all steps from 1-4 are using the cache, but when encountered an ADD instruction, it fails to use the cache.
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version:
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:06:22 2018
OS/Arch: darwin/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:14:32 2018
OS/Arch: linux/amd64
Experimental: true
I can't reproduce in my system, or your produce steps list above is not exactly match your actual operation.
First you need to tag the image you're building like this: docker build -t shivawu/test-cache-from ., then you can test if the cache is OK with: docker build --cache-from shivawu/test-cache-from -t shivawu/test-cache-from:test0 .
Description
Steps to reproduce the issue:
docker build --cache-from shivawu/test-cache-from .
Describe the results you received:
Describe the results you expected:
As you can see, the two run of
docker build
diverge from step 5, all steps from 1-4 are using the cache, but when encountered anADD
instruction, it fails to use the cache.Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: