64

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?

veben
  • 19,637
  • 14
  • 60
  • 80
viewking
  • 675
  • 1
  • 6
  • 8

4 Answers4

73

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/

Zeromus
  • 4,472
  • 8
  • 32
  • 40
  • 1
    thanks, You are right !The error happened, there is a connection refused – viewking Jul 20 '16 at 03:10
  • 5
    how to know if there is an error while building up? for me it is showing `Successfully built` but shows : – Vishrant Jan 17 '18 at 04:01
  • @Vishrant, in general you can see the build output (and don't use `-q` or `--quiet`). – Darius Feb 02 '18 at 14:33
  • I am getting a successfull built and if i immediately run docker run command i see the name but some how after sometime the name is getting set to none. can someone please help? – Shashank Srivastava Aug 02 '20 at 16:44
  • 2
    This solved my problem. If your build ends in something like `Running in e3e4cc0a2264` then it means that your docker image hasn't finished building because there's a command that is "hanging" (in my case a python script that hadn't finished). – joe Mar 01 '21 at 13:56
10

Tag an image referenced by ID To tag a local image with ID “0e5574283393” into the “fedora” repository with “version1.0”:

docker tag 0e5574283393 ExampleApps/myapp:version1.0

T.Todua
  • 53,146
  • 19
  • 236
  • 237
1

I know it's years later, but people still find this question via search and here's another reason for that error.

I mistakenly reused a build command without changing the tag parameter. It appears that the new build will take the tag, and the old one will switch to the double none.

waghdude
  • 19
  • 3
0

I was also confused. I always had the image with the name . Until I looked at the error message. A big thank you here to @Zeromus.

Step 4/8 : COPY package*.json ./
COPY failed: no source files were specified

That was the error for me. I accidentally had my Dockerfile in the wrong folder. Ok, I'm sure this doesn't happen to many people, but for those who are also wondering. It can be a possible error.

Otherwise, if it happens: it's an error in your Dockerfile.

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79