3

How do I force gitlab-runner exec docker to use a local image?

Using Docker executor with image docker_compose:0.0.1 ...
Using docker image sha256:be4b46f2adbc8534c7f6738279ebedd6106969695f5e596079e89e815d375d9c for predefined container...
Pulling docker image docker_compose:0.0.1 ...
ERROR: Job failed: Error response from daemon: pull access denied for docker_compose, repository does not exist or may require 'docker login'
FATAL: Error response from daemon: pull access denied for docker_compose, repository does not exist or may require 'docker login' 
1

You can use --docker-pull-policy never:

gitlab-runner exec docker --docker-pull-policy never

It will not try to download any image, relying only on the local cache, which includes images you have either pulled or built yourself.

5
  • How does this fix the problem that had been posed? – music2myear Jul 25 '19 at 23:34
  • It will not try to download any image, relying only on the local cache. – guludo Aug 2 '19 at 15:08
  • Adding that explanation to the body of your answer will improve it. – music2myear Aug 4 '19 at 22:11
  • Thanks for the advice. I've updated my answer. – guludo Aug 5 '19 at 19:12
  • I used if-not-present to be able to pull images from other repositories as well as using the local cache – Ayberk Özgür Jan 5 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.