Reputation: 2672
The following .gitlab-ci.ylm
file contains two stages and a request for an image:
image: alpine
stages:
- test
- build
random-job-1:
stage: build
script: echo "I am Job-1"
random-job-2:
stage: test
script: echo "I am Job-2"
The pipeline shows that the image
is pulled per stage
, hence twice for this pipeline.
Is there any way to avoid multiple pulls of the specified image
by pulling an image
per pipeline:
Runner
is used (e.g. local workstation)?Runner
of GitLab.com
is used?Upvotes: 2
Views: 893
Reputation: 41119
When you use a self-hosted runner with a docker
based executor, images cached on the host are reused according to the pull policy configuration. By default, images are cached and reused so long as there is not a newer image available than the image that is already cached.
On gitlab.com, shred runners run on autoscaling instances that are short-lived, so there won't be any images cached on it. Because any given job can be picked up by any number of potentially thousands of machines, caching doesn't make sense in the context of gitlab.com -- the images are always pulled for each job
Upvotes: 4