Skip to content

Instantly share code, notes, and snippets.

@jonasschneider
Created January 19, 2017 06:40
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 jonasschneider/9e0bf96429444c89da1749225d89750a to your computer and use it in GitHub Desktop.
Save jonasschneider/9e0bf96429444c89da1749225d89750a to your computer and use it in GitHub Desktop.
Docker --cache-from not working as expected
$ docker run -ti --privileged docker:1.13.0-dind &
$ docker run -ti --privileged docker:1.13.0-dind &
(they have IPs 172.17.0.{27,28})
$ DOCKER_HOST=tcp://172.17.0.27:2375 docker/docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
$ cat sleep/Dockerfile
FROM ubuntu:14.04
RUN sleep 10
$ DOCKER_HOST=tcp://172.17.0.27:2375 docker/docker build -t myrepo.local/jonas-cachetest3:v0 sleep
Sending build context to Docker daemon 2.048 kB
Step 1/2 : FROM ubuntu:14.04
14.04: Pulling from library/ubuntu
16da43b30d89: Pull complete
1840843dafed: Pull complete
91246eb75b7d: Pull complete
7faa681b41d7: Pull complete
97b84c64d426: Pull complete
Digest: sha256:881befbe6f54c1e85029fe3a11554342bf765a0849600ecb8fa2f922798b4925
Status: Downloaded newer image for ubuntu:14.04
---> 3f755ca42730
Step 2/2 : RUN sleep 10
---> Running in faa7b7a8eb62
[sleeps]
---> e13f3e14e2df
Removing intermediate container faa7b7a8eb62
Successfully built e13f3e14e2df
$ DOCKER_HOST=tcp://172.17.0.27:2375 docker/docker push myrepo.local/jonas-cachetest3:v0
The push refers to a repository [myrepo.local/jonas-cachetest3]
4fcb79d431cc: Pushed
4375cecd293e: Pushed
738d3f35b582: Pushed
53edc9780c07: Pushed
bc224b1b676d: Pushed
v0: digest: sha256:5b9e3e82faf7670ae003a8a1e0cb1c29a2366354282a2d70b10527e98b753345 size: 1359
$
$ DOCKER_HOST=tcp://172.17.0.28:2375 docker/docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
$ DOCKER_HOST=tcp://172.17.0.28:2375 docker/docker pull myrepo.local/jonas-cachetest3:v0
v0: Pulling from jonas-cachetest3
10e6c678e7af: Pull complete
da8f233a88a5: Pull complete
8e7d63e71a8f: Pull complete
b29dcc02a811: Pull complete
7ed6add7b5ec: Pull complete
Digest: sha256:5b9e3e82faf7670ae003a8a1e0cb1c29a2366354282a2d70b10527e98b753345
Status: Downloaded newer image for myrepo.local/jonas-cachetest3:v0
$ cat sleep/Dockerfile
FROM ubuntu:14.04
RUN sleep 10
$ DOCKER_HOST=tcp://172.17.0.28:2375 docker/docker build --cache-from myrepo.local/jonas-cachetest3:v0 sleep
Sending build context to Docker daemon 2.048 kB
Step 1/2 : FROM ubuntu:14.04
14.04: Pulling from library/ubuntu
16da43b30d89: Pull complete
1840843dafed: Pull complete
91246eb75b7d: Pull complete
7faa681b41d7: Pull complete
97b84c64d426: Pull complete
Digest: sha256:881befbe6f54c1e85029fe3a11554342bf765a0849600ecb8fa2f922798b4925
Status: Downloaded newer image for ubuntu:14.04
---> 3f755ca42730
Step 2/2 : RUN sleep 10
---> Running in 467a61911019
[sleeps; i would have expected this to NOT SLEEP]
---> bef2cf98d6df
Removing intermediate container 467a61911019
Successfully built bef2cf98d6df
$ DOCKER_HOST=tcp://172.17.0.27:2375 docker/docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment