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

DockerDocker BuildDocker for-MacDocker Desktop

Docker Problem Overview


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?

Docker Solutions


Solution 1 - Docker

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/

Solution 2 - Docker

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

Solution 3 - Docker

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.

Solution 4 - Docker

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionviewkingView Question on Stackoverflow
Solution 1 - DockerZeromusView Answer on Stackoverflow
Solution 2 - Dockerkarthikeyan paneerselvamView Answer on Stackoverflow
Solution 3 - DockerwaghdudeView Answer on Stackoverflow
Solution 4 - DockerMaik LowreyView Answer on Stackoverflow