Caching docker image


#1

Hi, we are using our own docker image as our base installation. On the first build it downloads the image as expected then any changes in the commit uses the cached version, which is all good.

However all our projects use the same base docker image so is there anyway to cache this at a a higher level even if its by repo name and not by the commit id? This would really speed up our builds.

version: 2
executorType: docker
containerInfo:

  • image: repo/image:latest

#2

Host machines on the docker executor automatically cache docker images. Since we run builds in a fleet of hosts, you may get consecutive builds that run on different hosts and don’t have that cache. As you run more builds, the chances of this approaches zero.


#3

Thanks Eric that makes sense.


#4

What about machine executor? Since a new VM is created every time, there will be no automatic caching?

I observe no caching, so I’ve been puzzling over “The Docker images used for CircleCI 2.0 job runs are automatically cached on the server infrastructure where possible.” from https://circleci.com/docs/2.0/caching/#introduction

If that sentence only applies to docker executor, then that sentence should be clarified. I’m happy to send a PR.


#5