Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"naming to docker.io", explanation and prevention?

Tags:

Naming to docker.io/library/imageName

When I build an image from a dockerfile, I see this statement appear in the docker build log, as the last statement of the build log that prints in the console.

What does this mean? Does this mean a copy of the image has been pushed to docker.io?

If so, is there any way to prevent this? It seems to continue happening even if I run docker logout.

If it matters, I am currently using a fresh install of docker for windows with wsl2 integration, and am running the docker build command within ubuntu linux.

like image 907
Robert Christ Avatar asked Feb 26 '21 23:02

Robert Christ


People also ask

What is docker IO library name?

docker.io/library is the default registry applied when you don't specify a registry URL. When you specify -t in the build command, the text before the / is considered the registry URL. Here is an example of building an image, one without a specific registry and one with: # no registry specified ➜ docker build . -

What is docker io?

docker-io is the deb package name used by Ubuntu distribution docker-engine is the deb package name from the official Docker Ubuntu distribution. Probably you want docker-engine because the Ubuntu one is too old and buggy to be used. As of today Ubuntu has 1.6. 2 and Docker registry has 1.12.

How do I name a docker image?

You can rename your docker image by docker tag command. Use the below given command to do that. To rename docker container, use the rename sub-command as shown, in the following example, we renaming the container discourse_app to a new name disc_app.

Which of the following is the correct way to name a docker file?

You may name your Dockerfiles however you like. The default filename is Dockerfile (without an extension), and using the default can make various tasks easier while working with containers.


1 Answers

docker.io/library is the default registry applied when you don't specify a registry URL.

When you specify -t in the build command, the text before the / is considered the registry URL.

Here is an example of building an image, one without a specific registry and one with:

# no registry specified ➜  docker build . -t my-image [+] Building 0.5s (6/6) FINISHED  => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                   0.0s  => => transferring dockerfile: 86B                                                                                                                                                                                                                                                                                                                                    0.0s  => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                      0.0s  => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                        0.0s  => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                                                                                                                                                        0.0s  => CACHED [1/2] FROM docker.io/library/ubuntu:20.04                                                                                                                                                                                                                                                                                                                   0.0s  => [2/2] RUN cat /etc/lsb-release                                                                                                                                                                                                                                                                                                                                     0.4s  => exporting to image                                                                                                                                                                                                                                                                                                                                                 0.0s  => => exporting layers                                                                                                                                                                                                                                                                                                                                                0.0s  => => writing image sha256:4a97ceefb5314bdf91886a28142c9b0b33c992c94b1847d5ae1b38723b2279e3                                                                                                                                                                                                                                                                           0.0s  => => naming to docker.io/library/my-image                                                                                                                                                                                                                                                                                                                0.0s  # registry set to "my.docker.registry" ➜ docker build . -t my.docker.registry/my-image [+] Building 0.1s (6/6) FINISHED  => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                   0.0s  => => transferring dockerfile: 36B                                                                                                                                                                                                                                                                                                                                    0.0s  => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                      0.0s  => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                        0.0s  => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                                                                                                                                                        0.0s  => [1/2] FROM docker.io/library/ubuntu:20.04                                                                                                                                                                                                                                                                                                                          0.0s  => CACHED [2/2] RUN cat /etc/lsb-release                                                                                                                                                                                                                                                                                                                              0.0s  => exporting to image                                                                                                                                                                                                                                                                                                                                                 0.0s  => => exporting layers                                                                                                                                                                                                                                                                                                                                                0.0s  => => writing image sha256:4a97ceefb5314bdf91886a28142c9b0b33c992c94b1847d5ae1b38723b2279e3                                                                                                                                                                                                                                                                           0.0s  => => naming to my.docker.registry/my-image 

The image tag specifies where the image will be uploaded if you do a docker image push <image name>.

In the first case, if you did docker image push my-image it would push to docker.io/library.

In the second case, if you did docker image push my.docker.registry/my-image it would push to a registry at the URL my.docker.registry (assuming it exists)

like image 134
swysocki Avatar answered Sep 22 '22 14:09

swysocki