Skip to content

Cache miss with cache-from on COPY command #198

@volfyd

Description

@volfyd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions