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

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>.

  • Different behaviour between 'docker run' and running command from bash within container
  • docker push fails due to “unauthorized: authentication required”, using gitlab
  • Codeception web driver (Selenium on Docker) tests not working as unable to see other containers (works on my dev machine though?!)
  • What is the difference between an untaggedImage & deletedImage in the docker source?
  • docker registry v2, where do buffered or pushed images get stored
  • How to fix “Pseudo-terminal will not be allocated because stdin is not a terminal” in Alpine Linux?
  • $ 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
    

  • How do I stop docker's virtual machine so I can install VirtualBox?
  • How to debug seg fault in docker container?
  • Managing resources (database, elasticsearch, redis, etc) for tests using Docker and Jenkins
  • Use host networking and additional networks in docker compose
  • Docker file to run Python with Pandas
  • How can I make my own base image for Docker?
  • One Solution collect form web for “What are <none> repository and tags? Why do they appear when I use docker build?”

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.