Can I pull from private images Docker hub free private repo? - docker

I am trying to pull my private images from Docker hub free private repo.
Here is what I have done.
Verify that myrepo/myimage exists in Docker Hub as private image.
Run the following
$ docker login docker.io -u myusername
Password:
WARNING! Your password will be stored unencrypted in /home/sha/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
$ docker push myusername/xxx-test:latest
The push refers to repository [docker.io/myusername/xxx-test]
e836ed963202: Pushed
24769bc5b044: Pushed
75b121557396: Pushed
4075573f4aa9: Pushed
fa6f238ab393: Mounted from myusername/multi-worker
d6100d978ba2: Mounted from myusername/multi-worker
88b43919be61: Mounted from myusername/multi-worker
0fcbbeeeb0d7: Mounted from myusername/multi-worker
latest: digest: sha256:985d3ed5e09915d5c84431243d511798ac4219a69ca3e73c6514dcb903b32853 size: 1990
$ docker pull myusername/xxx-test:latest
Error response from daemon: pull access denied for myusername/xxx-test, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Howver, Docker hub showed it had been pulled.
I have searched SO and googled on the same topic and tried all their suggestions. Nothing worked so far. It will work only if I go to the image settings an make it public.
Any input?
Update
Following the login command I immediately did a push, which was successful.
Then immediately did a pull for the same image, which failed.

Related

Can't push or pull image after adding a new tag (docker hub)

I'm trying to push a new image to docker hub when adding tags.
Initially the push works ok:
docker build -t myimage .
docker tag myimage myuser/myrepo:latest
docker push myuser/myrepo:latest
but after i add another tag it didn't let me:
docker tag myuser/myrepo:latest myuser/myrepo:another
i got:
denied: requested access to the resource is denied
it's the same when i try to pull my repo:
docker pull nicoplw/culo2:latest
i got:
Error response from daemon: pull access denied for nicoplw/culo2,
repository does not exist or may require 'docker login': denied:
requested access to the resource is denied
Note that my repo is in docker hub after i initially pushed it.
I tried with
docker logout
docker login
and also with
docker login -u username -p password
i always get "login successfull"
i tried every stackoverflow and docker forums question but i couldn't make it work. What am i missing here?
thanks!
It happens to be that you can only have 1 private repository.
If you create a second one it will somehow be created, but if you try to pull or push it will give this pull/push login error.
Solution: delete all your repositories if you want to push a new one, or make it public.
I think the issue is with your push command
Can you revisit your command or can you share the exert command which you are using

docker pull voting-app throws access to the resource is denied error

An attempt to pull the voting-app image throws resource denied error.
Error response from daemon: pull access denied for voting-app, the repository does not exist or may require 'docker login': denied: requested access to the resource is denied
could I have a solution to it, please?
From the error message, it is clear that either the image you are trying to pull is not present in DockerHub or you need to login into your DockerHub account.
If image not present in DockerHub, first push your image into DockerHub, then only you can pull it.
$ docker push yourDockerHubAccountName/voting-app
$ docker pull voting-app
Login into your DockerHub account:
docker login --username=yourHubUserName --email=yourRegisteredEmail#provider.com
You will be prompted for password on the bash screen. Enter your password to access all the public images ever uploaded on DockerHub.

How to pull from docker hub - pull access denied repository does not exist or may require 'docker login'

I have pulled images from Docker before - some time ago - but now it seems things have changed.
Take for example https://hub.docker.com/r/datagrip. Documentation states installation as follows
docker pull sath89/oracle-xe-11g
This no longer works with current Docker hub. I can try latest
[myuser:~] $ docker pull sath89/oracle-xe-11g
Using default tag: latest
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
Or tag 11.2
[myuser:~] 1 $ docker pull sath89/oracle-xe-11g:11.2
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
Of course I can try login - login succeeds but pulling images is still not working.
[myuser:~] 1 $ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: mydockerhubuser
Password:
WARNING! Your password will be stored unencrypted in /home/myuser/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[myuser:~] $ docker pull sath89/oracle-xe-11g:11.2
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
[myuser:~] 1 $
What is the secret nowadays for pulling images from Docker hub? It used to be so easy. Too easy clearly.

Creating tag for image pushing to repository

I have created repository in docker cloud andrejvi/andrejvi_repo and would like to place there image I have created.
Image name is dev_centos32
I do push:
sudo docker push andrejvi/dev_centos32
According to my understanding I must create tag for this image. How to do that?
Trying to push:
sudo docker push andrejvi/andrejvi_repo:dev_centos32
got error:
An image does not exist locally with the tag: andrejvi/andrejvi_repo:
UPD
I changed tag, but still can't push to repository
docker tag dev_centos32 andrejvi/andrejvi_repo/dev_centos32
sudo docker push andrejvi/andrejvi_repo/dev_centos32
The push refers to repository [docker.io/andrejvi/andrejvi_repo/dev_centos32]
0afb6e2f03f2: Preparing
d70d6ed6bc21: Preparing
denied: requested access to the resource is denied
UPD
Got error while login
$ sudo docker login andrejvi
Username: andrejvi
Password:
Error response from daemon: Get https://andrejvi/v2/: dial tcp: lookup andrejvi on 127.0.1.1:53: server misbehaving
denied: requested access to the resource is denied
You need to login into Docker Hub/Docker Cloud repository using the command:
docker login
Take a look at Push images to Docker Cloud.
Try:
docker login
docker tag dev_centos32 {docker-hub-username}/andrejvi/andrejvi_repo/dev_centos32
docker image push {docker-hub-username}/andrejvi/andrejvi_repo/dev_centos32

Access denied when pulling Docker image from a repository I own

I built a Docker image that I pushed to Docker Hub under my account and removed locally after. But when I try to pull it, it throws the following error:
Error response from daemon: pull access denied for mightyspaj/dockerfile-assignment-1, repository does not exist or may require 'docker login'
I'm logged into the same account that owns the repository for this image and can perform other tasks (such as pushing) perfectly fine. The repository also definitely exists on Docker Hub, yet it fails when I try to pull it.
I've tried the following things:
Logging out of my account and back in again
Renaming config.json and regenerating it
Running an isolated Docker container with docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock:ro docker sh, then logging into my account and attempting to pull the image
Deleting and recreating the repository
All of these things still produce the same error. I'm baffled.
To note, both my client and engine versions are 17.12.0-ce. My OS is Ubuntu 17.10 (64-bit).
Console output
docker login
-> % docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: mightyspaj
Password:
Login Succeeded
docker tag
-> % docker tag dockerfile-assignment-1:latest mightyspaj/dockerfile-assignment-1
docker push
-> % docker push mightyspaj/dockerfile-assignment-1
The push refers to repository [docker.io/mightyspaj/dockerfile-assignment-1]
8427a8e6a29f: Pushed
655a921743e8: Pushed
8aa44edb7524: Pushed
60f1a2dc4cd8: Mounted from library/node
9185fe936b87: Mounted from library/node
e53f74215d12: Mounted from library/node
latest: digest: sha256:6c68220ba84f13d0229ef4458f22369410bb98764b908a75be0849c3003de160 size: 1582
docker image rm
-> % docker image rm mightyspaj/dockerfile-assignment-1
Untagged: mightyspaj/dockerfile-assignment-1:latest
Untagged: mightyspaj/dockerfile-assignment-1#sha256:6c68220ba84f13d0229ef4458f22369410bb98764b908a75be0849c3003de160
docker image pull
-> % docker image pull mightyspaj/dockerfile-assignment-1
Using default tag: latest
Error response from daemon: pull access denied for mightyspaj/dockerfile-assignment-1, repository does not exist or may require 'docker login'
I could fix the same issue only when I made the repository public. Make sure the repository is public then this is the set of instructions I followed in command line:
Once logout from docker hub and login again.
1- docker logout
2- docker login --username=YOURUSERNAME
Enter password when asked
3- docker pull repositoryName"/"imageName[:tag]
if "tag" is not included the default value will be "latest".
Then check the images by docker images command to check if its been pulled.
After pulling is done I made the repository private again.
This solution is only valid on private docker repositories!!
First try to login on your private repo e.g:
docker login dockerrepo.example.com
Then
If you build new image with dockerfile based on image in your private repository then you must prefix your base image with private repository url:
FROM PRIVATE_REPO_URL + IMAGE_INFO
sample:
PRIVATE_REPO_URL --> dockerrepo.example.com
BASE_IMAGE --> samples/java/jdk:1.6
Your dockerfile look like this:
FROM dockerrepo.example.com/samples/java/jdk:1.6

Resources