Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache miss with cache-from on COPY command #198

Open
volfyd opened this issue Aug 18, 2020 · 1 comment
Open

Cache miss with cache-from on COPY command #198

volfyd opened this issue Aug 18, 2020 · 1 comment
Labels

Comments

@volfyd
Copy link

volfyd commented Aug 18, 2020

Hi,

I wanted to start using the cache-from feature, but I noticed that no matter what I was doing, COPY commands in my Dockerfile were always missing the cache. I eventually realized that it has to do with the version of the docker client that built the image I'm using in cache-from.

image=foo:
    image: foo
    cache-from: [ 'bar:current' ]
    context: foo
    tags: [ 'current' ]

If I run:

docker -t bar:current foo
dobi foo

I get a cache miss on COPY instructions. If I downgrade the docker client to

Client:
 Version:      17.09.1-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   19e2cf6
 Built:        Thu Dec  7 22:21:47 2017
 OS/Arch:      linux/amd64

and start over, caching starts working correctly. I tried 17.12.0 and up, and those all have the problem.

Would this require the go-dockerclient library to support a higher client version? I don't know if something changed with the way hashes are computed.

@dnephin
Copy link
Owner

dnephin commented Sep 3, 2020

I'm not sure, but you can set the API version that the client sends to the server with the DOCKER_API_VERSION environment variable. go-dockerclient supports the same variable. Maybe that will work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants