When I run docker images
I can see the repository, tag, imageid, size. But there is no image name column.
Can we say that image name is a combination of repository and tag - repository:tag
? And that at any point of time there can be only 1 image with the same repository name and tag value combination?
An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. Also, within a docker repository, a docker image can have multiple tags, but multiple docker images cannot have the same tag.
Note: Container names must be unique. That means you can only call one container web . If you want to re-use a container name you must delete the old container (with docker container rm ) before you can create a new container with the same name. As an alternative you can use the --rm flag with the docker run command.
If you reassign a tag that is already used, then the original image will lose the tag, but will continue to exist (it will still be accessible by its image ID, and other tags might refer to it). They have both a name and a tag. You can verify that below. docs.docker.com/v17.09/engine/reference/commandline/build/…
Answer to both of your questions is YES
As mentioned in the docs:
An image name is made up of slash-separated name components, optionally prefixed by a registry hostname.
Basically, this is how your docker image name looks like:
<hub-user>/<repo-name>:<tag>
Now we can have multiple repositories in our docker hub account but, as mentioned in the docs, The repository name needs to be unique in that namespace
Also, within a docker repository, a docker image can have multiple tags, but multiple docker images cannot have the same tag.
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