Error response from daemon: pull access denied for TestDockerImage
Asked Answered
B

3

12

I am new to docker and Jenkins2. I am trying to pull docker image from private docker repository.

pipeline {
         agent{
            docker{
                image "PrivateRepo/Test"
                args "--username testUser --password pass -v /var/jenkins_home/workspace:/home --env "
            }
        }
        stages {
                .
                .
                .
               }
 }

when I run Jenkins file it gives me below error

Error response from daemon: pull access denied for PrivateRepo/Test, repository does not exist or may require 'docker login'

Where do I give docker credential or how can I provide access to repository.

Bazemore answered 19/12, 2017 at 14:40 Comment(1)
your user on the jenkins server should have the rights to manage dockerCurate
U
4

The registry "PrivateRepo" requires a login to all pulling images from it. If you have access to the machine where jenkins is running, you can simply do that by executing:

docker login PrivateRepo

Alternatively, you can do it from jenkins as described in here.

Unready answered 19/12, 2017 at 15:41 Comment(0)
Q
9

Faced the similar problem while pulling the nginx image with command:

docker run --rm -p 8088:80 ngnix

Actualy, i was providing the wrong image name and it does not report for wrong image and displayed the above message.And hence after correcting the image name using command

docker run --rm -p 8088:80 nginx

It worked fine after this change.

Quaggy answered 10/12, 2019 at 8:57 Comment(0)
U
4

The registry "PrivateRepo" requires a login to all pulling images from it. If you have access to the machine where jenkins is running, you can simply do that by executing:

docker login PrivateRepo

Alternatively, you can do it from jenkins as described in here.

Unready answered 19/12, 2017 at 15:41 Comment(0)
S
0

In my case I had not loaded the particular image into docker:

sudo docker load -i <image_name> 

solved my issue

Sollows answered 14/12, 2022 at 6:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.