dockerdocker-builddocker-for-macdocker-desktop

docker build with Dockerfile, but the image has no name or tag


I installed Docker desktop for mac. The version is 1.12.0-rc4-beta19

when I use docker build -t self/centos:java8 .

the image has no name or tag

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              1581ffcbfd7f        5 minutes ago       196.8 MB

What is wrong with the build command?


Solution

  • is your image building correctly? the name does not get set when there is an error in the build. This because every step in the build is a new image created and with an error you won't get to the last step with the correctly named image

    btw you can set it manually with the tag command https://docs.docker.com/engine/reference/commandline/tag/