docker pull returning image not found - docker

docker pull localhost:21518/master:latest
Getting following response:
Trying to pull repository localhost:21518/master ...
Pulling repository localhost:21518/master
Error: image master:latest not found
Whereas docker images returns
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost:21518/master latest e9f29fbf9931 6 hours ago 703 MB
Why image is not getting pulled?

docker images shows the list of cached images and not repository images. I got confused that docker images showing images from repository as repository is also running on local machine.
Needed to do docker push to get image in repository.

Related

Docker Registry: Newly tagged image can be found, but not found when pulled

Using :latest image as a base, I have created a new image tagged with :v1.1.0-fermium. After tagging, the newly tagged image :v1.1.0-fermium appears within registry listing of docker images, including :latest
Problem: The :latest image can be pulled from registry, but not the newly tagged :v1.1.0-fermium image, not found registry.
Question: Is there a step I am missing when tagging a docker image in order to be found when pulling from a docker registry?
$ docker image tag docker.foo.com/bar-build:latest docker.foo.com/bar-build:v1.1.0-fermium
$ docker image ls docker.foo.com/bar-build
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.foo.com/bar-build latest 35bfeb2c6323 5 hours ago 5.03GB
docker.foo.com/bar-build v1.1.0-fermium 35bfeb2c6323 5 hours ago 5.03GB
$ docker pull docker.foo.com/bar-build:latest
latest: Pulling from bar-build
$ docker pull docker.foo.com/bar-build:v1.1.0-fermium
Error response from daemon: manifest for docker.foo.com/bar-build:v1.1.0-fermium not found: manifest unknown: The named manifest is not known to the registry.
Kindly Push the docker image into hub.docker.com for publishing it and then you can pull the image.

Docker pull: still having old image after pull

I noticed that the docker image I'm using is older than the one on dockerhub. Running docker pull seems to work, but later when running docker images I still see the old image, even if I first explicitly removed it with docker rmi.
Output of docker pull:
# docker pull staltz/ssb-room
Using default tag: latest
latest: Pulling from staltz/ssb-room
9a0b0ce99936: Already exists
db3b6004c61a: Already exists
f8f075920295: Already exists
6ef14aff1139: Already exists
0bbd8b48260f: Pull complete
524be717efb1: Pull complete
aad1e8812bc2: Pull complete
13fb072986db: Pull complete
627a2df19018: Pull complete
fb8dcb3732a4: Pull complete
2bc41d47dd50: Pull complete
058f4db9be8e: Pull complete
8f21c57f425d: Pull complete
Digest: sha256:a7c49c796823312f8c1d155eb636bbd974bc55036c2180f16f17d3340fcebbe7
Status: Downloaded newer image for staltz/ssb-room:latest
docker.io/staltz/ssb-room:latest
Output of docker images:
# docker images staltz/ssb-room
REPOSITORY TAG IMAGE ID CREATED SIZE
staltz/ssb-room latest 6097b401900c 4 months ago 930MB
Why is it again showing that 4-months old image?

repository X not found: does not exist or no pull access-docker

I created one docker repository by importing from tar ball.
REPOSITORY TAG IMAGE ID CREATED SIZE
sample-one-adv6-6.19.1.403 latest 0e9312c86f03 33 minutes ago 1.74 GB
but when i use
docker image pull -a sample-one-adv6-6.19.1.403
i get error message
Error response from daemon: repository sample-one-adv6-6.19.1.403 not found: does not exist or no pull access
How can i pull all tagged images in the repository?

Content of a Docker Image that is pushed to DockerHub

I created a Docker image locally using following sample Docker file
FROM ubuntu
ADD myfile.zip /opt/myfile.zip
If I push the built image to DockerHub as a public image, does that image
contain both files from ubuntu image and myfile.zip or does it only contain myfile.zip? If it contains only myfile.zip, when someone pull the image from DockerHub does he have to manually / automatically pull ubuntu image first?
The image will contain the Ubuntu docker image, and your mufile.zip.
You can check the size shown by
docker images ubuntu
and
docker images yourimage
Things may have changed since this article
https://www.brianchristner.io/docker-image-base-os-size-comparison/
but Ubuntu was 188 MB at that time, your image should be bigger by the size of your zip
This docker documentation explains it
https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/

Why does "docker push" push several images and where?

I have private repo on docker hub named alek/test.
On my Mac:
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
alek/test 0.1 dc1a7cc41129 33 minutes ago 643 MB
node 0.12.7 9e20baae42c8 5 days ago 641.6 MB
$ docker push alek/test
The push refers to a repository [docker.io/alek/test] (len: 1)
dc1a7cc41129: Image successfully pushed
537a913fe639: Image successfully pushed
b40236e9037f: Image successfully pushed
53c8b1d50397: Image successfully pushed
e8c37c1e2189: Image successfully pushed
68bbfd9543a7: Image successfully pushed
9e20baae42c8: Image already exists
8b74d7a75802: Image successfully pushed
3383909e8f95: Image already exists
e0919a8b95a8: Image already exists
6ad0799af6bd: Image successfully pushed
9213e81cb0f2: Image successfully pushed
607e965985c1: Image successfully pushed
1ff9f26f09fb: Image successfully pushed
9a61b6b1315e: Image already exists
902b87aaaec9: Image successfully pushed
0.1: digest: sha256:a2b1d8a3b283f13e8d6a1407e886ca8ee62d93377949e050b9e05509ce6aaf86 size: 30568
What just have happened??? Why several images have been pushed? Also where they were actually pushed - nothing changed on my private repo on docker hub (screen).
I am not sure If I understand docker hub correctly.
What I want is to build image from Dockerfile and push it to my repo to make it available for a client to pull it on his side and run in container...
You understand correctly.
There is an image for each layer in the image, corresponding to each instruction in a Dockerfile. Docker pushes these layers independently.
As you didn't specify a tag, Docker will push all the tags in the repository (in this case just 0.1). Anyone with access to your repository should be able to download it with docker pull alek/test:0.1. If you look at the tags tab on the Hub, you should see your images there.
If you do a docker push without a tag, I think it pushes the whole repo - i.e. all the images. If you do docker run or docker pull without a tag, it will use the latest tag. So I assume the 0.1 tag got pushed in your case, but you would need to say docker pull alek/test:0.1 to pull it.

Resources