0

I'm using Gitlab CI with a gitlab-runner installed on our server. We can then assume that each jobs will be executed on the same machine.

  • build: build image image and push as image:git_commit
  • test: pull image:git_commit and test
  • tag: pull image:git_commit, tag it to latest and push to image:latest

For performance I set cache_from: image:latest in my docker-compose configuration. However, it seems that each jobs is executed in a separate gitlab-runner docker instance so it does not actually keep images. In practice, this makes the runner to download image each time even though it was previously built on this very machine.

My question is:

  • how can I setup my host to keep image:latest cached (and up-to-date) and share it with my runner instances?

Thanks


Edit: I set pull_policy = "if-not-present" in my /etc/gitlab-runner/config.toml, the fullpath image is present in my host e.g. registry.gitlab.com/user/project/image:latest is listed in docker images

pltrdy
  • 2,069
  • 1
  • 11
  • 29

0 Answers0