Home > Back-end >  Gitlab: unable to pull image from docker hub?
Gitlab: unable to pull image from docker hub?

Time:07-25

I am trying to build a docker image for my application inside docker container, this is example of docker insider docker concept.

I am trying to pull docker image, here is the yaml code for my gitlab job

build_image:
  image: docker:20:10:17
  services:
    - docker:20.10.17-dind
  variables:
   DOCKER_TLS_CERTDIR: "/certs"
  before_script:
    - docker login -u $REGISTRY_USER -p $REGISTRY_PASS
  script:
    - docker build -t $IMAGE_NAME:$IMAGE_TAG .
    - docker push $IMAGE_NAME:$IMAGE_TAG

Every time the pipeline runs it shows this error

Pulling docker image docker:20:10:17 ...
WARNING: Failed to pull the image with policy "always": invalid reference format (manager.go:235:0s)
ERROR: Job failed: failed to pull image "docker:20:10:17" with specified policies [always]: invalid reference format (manager.go:235:0s)

Note:- I am using the managed runner on gitlab

CodePudding user response:

you're using colons here: docker:20:10:17

but you should be using dots: docker:20.10.17

  • Related