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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.