Cache: Still importing image for cavo

docker
caching

#1

On Codeship PRO. I have a docker image for my code that is reliant on a base image:

myorg/base

FROM ubuntu:trusty
RUN do_stuff
RUN do_more_stuff

myorg/cavo

FROM myorg/base
RUN do_stuff
RUN do_more_stuff

codeship-service.yml

cavo:
  build:
    image: myorg/cavo
    context: docker/cavo
    dockerfile: Dockerfile
  cached: true

codeship-steps.yml

- type: serial
  service: cavo
  steps:
  - command: npm i
- type: push
  service: cavo
  tag: docker
  image_name: myorg/cavo
  image_tag: docker
  registry: https://index.docker.io/v1/
  encrypted_dockercfg_path: dockercfg.encrypted

Note, that I have cached: true in place. What’s odd to me is that the caching seems flawed. My image hasn’t changed in the past 5 builds but every time, Codeship seems to take 5-10 minutes with this:

2017-03-12T18:36:01.616Zbuild/import started for cavo
2017-03-12T18:37:01.616Zcache: Still importing image for cavo...
2017-03-12T18:38:01.616Zcache: Still importing image for cavo...
2017-03-12T18:39:01.616Zcache: Still importing image for cavo...
2017-03-12T18:40:01.616Zcache: Still importing image for cavo...
2017-03-12T18:41:01.616Zcache: Still importing image for cavo...
2017-03-12T18:41:52.080Zbuild/import finished for cavo

My image is 643MB, FYI.

I guess I just don’t see the point of the cache if it’s going to take that long to import the image. Is this literally how long it’s taking to copy the cached image from your S3 bucket to my dedicated instance? My actual build time is awesome at just a little over 2 minutes. Any help you can offer would be appreciated.


#3

Hey @Bill_Butler - this post here covers some of the changes introduced regarding caching - Changes to our Jet Platform Docker Caching Strategy

Essentially it’s all about the image sizes and there is a github thread in that post that I think you will find interesting - https://github.com/docker/docker/issues/20316

If you would like more details on how to reduce your image size and speed up the cache - you can read this ebook here - https://blog.codeship.com/reduce-docker-image-size/

Hope this helps, and sorry for the delayed response.


#4

Thanks. I’m finding that my images are downloading faster from dockerhub than from the cache, so I think I’ll just leave it disabled for now.