Unable to pull my private image from docker hub - docker

After I upgrade my docker from 1.8.2-el7 to version 1.12.6, its failing to pull my private images from docker hub.
I could able to perform the list image command
sudo docker -H tcp://test-app01.local:2376 images
REPOSITORY TAG IMAGE ID CREATED SIZE
account/image1 tag1 a4c286f0ec9e 10 hours ago 864.7 MB
ubuntu latest d355ed3537e9 8 days ago 119.2 MB
account/image1 tag2 4abd8c3ed720 3 months ago 878.8 MB
But it's unable to pull latest image from repo with successful login.
sudo docker -H tcp://test-app01.local:2376 login -u username -p password
Login Succeeded
sudo docker -H tcp://test-app01.local:2376 pull account/image1:tag1
Using default tag: tag1
Pulling repository docker.io/account/image1
Error: image account/image1:latest not found
Can somebody please assist to fix this issue.

As you can see in the image command, you have only tag1 and tag2 image tags.
If you don't specify any, docker will look for latest which you don't have. So pull as this for tag1:
sudo docker -H tcp://test-app01.local:2376 pull account/image1:tag1
Or this for tag2:
sudo docker -H tcp://test-app01.local:2376 pull account/image1:tag2

Related

How to push an image to the Docker registry using podman

Is it possible to push images to the Docker registry using podman?
I am running podman with the podman-docker (that claims to emulate the Docker CLI) package on fedora and I managed to successfully run docker login with my hub.docker.com credentials, but when I try to push an image it fails to connect.
It was enough to specify the address of the docker registry
docker push imageID docker://docker.io/username/ImageName:tag
For me, I had to be more explicit than the answer above:
podman system prune -a
podman login -u myuser -p mypassword docker.io/myuser/myimage
podman build -t localhost/myimage .
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/myimage latest 1546573dd25d About a minute ago 716 MB
docker.io/library/docker 19.03.12-dind 66dc2d45749a 20 months ago 227 MB
podman push 1546573dd25d docker://docker.io/myuser/myimage:1.0.0
I did add dockerhub to my registries.conf. Not sure if its stricly required.
$ cat /etc/containers/registries.conf
[registries.search]
registries = ['docker.io', 'quay.io']
But I can just push as you would expect with docker.
podman build -t myuser/myimage .
podman login -u myuser
podman push myuser/myimage
podman version is 3.4.2

What is the difference between docker run and docker pull

I am new to Docker. Can anyone help me in understanding the difference between
docker run img_name & docker pull img_name?
Do they work the same?
docker pull pulls an image or a repository from a registry.
docker run runs a command in a new container.
They don't work the same, however, if you use docker run with an image that you haven't pulled yet, docker run will call docker pull:
$ docker rmi hello-world
Untagged: hello-world:latest
Untagged: hello-world#sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc
Deleted: sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e
Deleted: sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc
Status: Downloaded newer image for hello-world:latest
…
Please see docker help pull and docker help run for more information.

Docker run does not display any output

I installed docker on a raspberry-pi (Connected via ssh)
Installation is successful.
But running docker run hello-world produce no output.
Note on very first time I got additional messages regard installing image
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ad0f38092cf2: Pull complete
Digest: sha256:e366bc07db5e8a50dbabadd94c2a95d212bc103e3557e47df8a2eebd8bb46309
Status: Downloaded newer image for hello-world:latest
But there is no actual output from hello world script
Note I installed docker using command curl -sSL https://get.docker.com | sh
I tried following command too
sudo usermod -aG docker pi
sudo systemctl start docker
sudo docker run hello-world
Tried following commands docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
734dd8f733d7 hello-world "/hello" About a minute ago Exited (139) 59 seconds ago thirsty_bhaskara
I ran into the same issue on a Raspberry Pi 1B+ (armv6l). Inspired by #JanDrábek's answer, the first observation is that the hello-world image would indeed be one supporting ARM, yet only after using hypriot/armhf-hello-world instead did I get the expected output:
$ uname -a
Linux 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux
$ docker run hello-world # No output
$ docker image inspect hello-world | grep Architecture # Arch looks right though
"Architecture": "arm",
$ docker run hypriot/armhf-hello-world # This does the job
Hello from Docker.
This message shows that your installation appears to be working correctly.
run:
docker ps -a
and check if you can see the exited container.
take the container ID from the output and type
docker logs <ID>
this will allow you to see the logs.
if you want to see the output in the first place when you run it add -it flags to the run command
edit:
I tried in on my machine:
docker run -it hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete
Digest: sha256:e366bc07db5e8a50dbabadd94c2a95d212bc103e3557e47df8a2eebd8bb46309
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
maybe your output is redirected to some other stream.
try using :
docker run -it hello-world > ./test.txt 2>&1
after that check if the file has any content
I was having similar issue, my solution was definitely very naive but I basically removed all container and images and then tried again. It worked.
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
I recently had same problem on my freshly installed Fedora 28 (up-to-date)... the containers all exited with exit code 139, the docker events said that it died, and docker logs said nothing.
My solution was to update the docker (or switch to CE edition) as the installed docker version was 1.13 which is quite old. (The tutorial for fedora https://docs.docker.com/install/linux/docker-ce/fedora/)
Also I have came across one potential thing to check... is your container compatible with your architecture (raspberry is ARM isn't it?) Use docker image inspect <image> search for Architecture.

Why cannot I show docker repo in local registry via web API after restarting registry:v2?

Below are steps to reproduce the issue.
docker --version
Docker version 17.09.1-ce, build 19e2cf6
docker images | grep centos
centos latest 3fa822599e10 3 weeks ago 204MB
docker tag centos:latest 127.0.0.1:5000/centos
docker push 127.0.0.1:5000/centos
The push refers to a repository [127.0.0.1:5000/centos]
d1be66a59bc5: Pushed
latest: digest:
sha256:3a32a170c945ffe18334b3f514fcb66f9c14001b2266c9ed8504c72db0acde11 size: 529
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
046a5d68c8b2 registry:2 "/entrypoint.sh /e..." About an hour ago Up About an hour 0.0.0.0:5000->5000/tcp festive_wozniak
curl -X GET http://localhost:5000/v2/_catalog
{"repositories":["centos"]} -----We can list 'centos' repo after pushing.
docker stop 046a5d68c8b2
046a5d68c8b2
docker run -p 5000:5000 -d registry:2
bad6ec7aad590f91aaf1721703ce6468e8254d159e56a5b5f018e5e3c25cf7e0
curl -X GET http://localhost:5000/v2/_catalog
{"repositories":[]} ---- after restarting registry, we cannot see 'centos' info
Each docker run creates a new container.
To restart a container you can either run docker start 046a5d68c8b2 (following your example) or use the --restart=always option to docker run.
See:
https://docs.docker.com/engine/reference/commandline/run/#restart-policies-restart

How to run the docker images that i pulled the "sudo docker pull ppc64le/alpine:edge" , but i am getting error while running this image

These are the methods tried to run the image , can anyone please help in running this edge pulled image.
$ sudo docker run -i -t ppc64le/alpine:edge /bin/sh -c "echo hello"
exec format error
docker: Error response from daemon: Cannot start container f6d4a9675de787258cdb0dd7f25abc2f51e956790a6f9b408da56af2fa309320: [9] System error: exec format error.
Where the normal alpine will work properly
$ sudo docker run -i -t alpine /bin/sh -c "echo hello"
Unable to find image 'alpine:latest' locally
Trying to pull repository docker.io/library/alpine ...
latest: Pulling from docker.io/library/alpine
627beaf3eaaf: Pull complete
Digest: sha256:58e1a1bb75db1b5a24a462dd5e2915277ea06438c3f105138f97eb53149673c4
Status: Downloaded newer image for docker.io/alpine:latest
hello
These are the images list , but i need to run the docker.io/ppc64le/alpine image .
]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/ppc64le/ubuntu 16.04 8a9bece55fb5 5 days ago 157.1 MB
docker.io/ppc64le/debian latest ed3456c89713 6 days ago 127.9 MB
docker.io/ubuntu latest f7b3f317ec73 9 days ago 117.3 MB
docker.io/fedora latest 15895ef0b3b2 12 days ago 230.9 MB
**docker.io/ppc64le/alpine edge 736257f91720 3 weeks ago 4.798 MB**
docker.io/ppc64le/fedora latest b288a3394151 3 months ago 349.4 MB

Resources