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.
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 . -
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.
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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With