Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are <none> repository and tags? Why do they appear when I use docker build?

Tags:

docker

This is what docker images shows before I run docker build.

$ docker images REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE myapp               latest              a38da0bd9e0b        6 seconds ago       523.8 MB golang              onbuild             b4997c557048        10 days ago         517.2 MB 

After I make some changes to the myapp source code, I run docker build -t myapp . and I end up with images named <none>.

$ docker images REPOSITORY          TAG                 IMAGE ID            CREATED                      VIRTUAL SIZE myapp               latest              a38da0bd9e0b        Less than a second ago ago   523.8 MB <none>              <none>              e4209f97e819        10 minutes ago               523.8 MB golang              onbuild             b4997c557048        10 days ago                  517.2 MB 

I know I can remove them with docker rmi <IMAGE ID>, but why does that happen in the first place? How can I prevent that from happening? The Dockerfile I'm building looks like this.

FROM golang:onbuild EXPOSE 8080 
like image 439
425nesp Avatar asked May 12 '15 00:05

425nesp


People also ask

What is docker repository and tag?

Docker provides the support for storing the images on the Docker Hub repository. A Docker tag provides a unique identity to a Docker image. There are sets of similar images with different versions identified by tags in a Docker repository. Here, we'll learn to tag an image using the docker build and docker tag command.

What are repositories in docker?

Docker Hub repositories allow you share container images with your team, customers, or the Docker community at large. Docker images are pushed to Docker Hub through the docker push command. A single Docker Hub repository can hold many Docker images (stored as tags).

What are the none docker images?

The Good <none>:<none> These are intermediate images and can be seen using docker images -a . They don't result into a disk space problem but it is definitely a screen "real estate" problem.

What is tag in docker command?

A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.


1 Answers

If you reassign a tag or image name to another image, your image will lose its tag or name. It's really that simple. Your myapp repo image tagged latest with ID a38da0bd9e0b used to be named and tagged on image ID e4209f97e819.

like image 145
L0j1k Avatar answered Oct 08 '22 14:10

L0j1k