Docker Cache

docker

#1

It would nice if CircleCi could cache the docker images and save a lot of time spend in docker builds. Like Codeship does.

I have an image that is taking some minutes to build and my CircleCi builds are taking more than 10minutos to finish, which is awful.

The only way I found to actually cache the docker images with circleci is do what is explained in this CircleCi doc and this blog post. But this is a lot of work, scripts to build and maintain, specially if you have multiple images and multiple projects.


Docker image too large for cache?
#2

This should be definitely implement as it would save a lot of time of docker buildings. :+1:


#3

Great idea Roberto!


#4

+1, this would be very good to have. I tried to do this by just specifying

dependencies:
  cache_directories:
    - "/var/lib/docker"

but that didn’t seem to do anything.


#5

+1 - this would lock a ton of use-cases, especially if your app builds or depends on more than a single container.


#6

Is there any update on this?


#7

+1 for this


#9

+1 for this.

We are not building images, but we use several docker images both on production and in development. And of course we launch those very same images for testing our applications on CircleCI, but it causes our tests to be much longer. Caching the images is a really big pro of CodeShip right now.


#10

I made a shell script that may help the caching issue Workaround Docker cache issue with docker-cache-shim

It’s working for my workflow now. Hopefully it does for others.


#11

Pulling images before building allows cached layers and is most likely significantly faster than building every layer every time. It would be nice if that was not needed though.


#12

Definitely looking forward to this being implemented. It would greatly increase our build times.


#13

Our build times would decrease from 12 minutes to just about 2 if this would be implemented. Absolutely a huge priority for a serious CI company :slight_smile:


#14

The good news is this is on our radar. In the coming weeks and months there will be non-trivial progress on this front, so stay tuned…


#15

Both codefresh and apparently codeship support it. it would be really helpful to understand what the timelines are because my builds are taking forever


#16

+1 for this. caching is one of the cooles docker features


#17

Any updates on this @ndintenfass?


#18

In the short term, Kim’s workaround earlier in this thread (Docker Cache) is what I would try. In the coming months, CircleCI 2.0 is our permanent solution to this problem: CircleCI 2.0 Now in Closed Beta


#19

+1, will use a workaround for now but this is a big deal for us.


#20

CircleCI 2.0 provides native docker support, faster build performance and greater environment control.

2.0 is now in Beta and you can start building on our latest platform by signing up at https://circleci.com/beta-access/


#21

Updated documentation for Docker Layer Caching: https://circleci.com/docs/2.0/docker-layer-caching/