Speed ​​up Gitlab CI for docker

Gitlab CI pulls in a docker image every time for every task (stage). This operation is time consuming. I want to optimize if possible.

I see two places to work:
1. Explicitly configure the CI steps to reuse the same docker machine.
2.use the docker machine from the previous commit when building the next commit? (If no changes have been made to the config file).

+3


source to share


1 answer


Such a configuration can be specified via pull_policy on the runner itself.

As noted by Yakub in the comments to the question, on shared members on Gitlab.com, the policy is set to always

, so it will always download a new copy of the image, also if there is a local copy.

For security reasons.



You may have confirmation of this in the doc .

This pull policy should be used if your Runner is public and configured as a shared Runner in your GitLab instance. This is to pull out a policy that can be considered safe when Runner is used with private images.

The security concept is that if the runner checks the local image first, an unauthorized user can get the private docker image guessing his name

+2


source







All Articles