I notice that docker pull takes a long time when running in pipelines. Is there a way to cache the latest docker image and use it as cache when docker pulling?
Hi Stevedan and welcome to the community!
Can you please clarify which of the following two you are referring to?
(1) The build container's Docker image that is being pulled at the beginning of every Pipelines step(2) Pulling an image during a Pipelines build with a docker pull image command
If you're talking about (1), we cache public Docker Hub images. If you use a public Docker Hub image as a build container, it's going to be pulled from our cache. We do not cache private Docker Hub images or images from other registries at the moment.
If you're talking about (2), you can cache the image you pull during your build. Please keep in mind though that there is a bug with the Docker cache at the moment and it is not being consistently used. This means that the cache may sometimes be used but other times not.
If you'd like to try it, you can adjust your step as follows:
- step: script: - docker image pull <your image here> services: - docker caches: - docker
If you try this, please do check if the docker cache is being used in your builds and if there's a benefit; otherwise, you may want to remove the docker cache until the bug is fixed, so that your builds won't spend time uploading and downloading a cache that isn't used.
Please feel free to reach out if you have any questions!
Kind regards,Theodora
isnt there a limit in caching size?
Hi Stevedan,
If we're talking about a Docker image that is cached during the build, like in the example I shared above in point (2), then yes, there is a limit. Only caches under 1 GB once compressed are saved. We compress the Docker image before uploading it to cache, and the size of the compressed image needs to be under 1 GB; otherwise, it won't be uploaded.
My docker image is larger, so this might not work for me. Is there a chance that we can get higher cache size?
It looks like you're new here. Sign in or register to get started.