I am new here trying to learn docker, I started this tutorial
https://docs.docker.com/engine/examples/nodejs_web_app/
Building your image
$ docker build -t mlotfi/centos-node-hello .
mlotfi
is my username in https://hub.docker.com/
when I did docker images
, I got:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> sha256:189cb 27 seconds ago 485.1 MB
centos centos6 sha256:d0a31 12 days ago 228.9 MB
instead of:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
mlotfi/centos-node-hello latest sha256:189cb 27 seconds ago 485.1 MB
centos centos6 sha256:d0a31 12 days ago 228.9 MB
UPDATE: at the end of the build I see :
Complete!
---> e053d8f57e5c
Removing intermediate container 060f921fd08c
Step 4 : COPY package.json /src/package.json
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and
directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and r
eset permissions for sensitive files and directories.
lstat package.json: no such file or directory
But I already have package.json in the src directory.
That can happen if your docker build sequence does not got all the way, meaning it stops on error at some point in the Dockerfile.
The result of that interrupted process is the last intermediate image built by the Dockerfile line that succeeded, just before the Dockerfile line that fail to execute properly.
Other reasons are listed in "What are Docker
<none>:<none>
images? "you can see an example of dangling image in "What are
<none>
repository and tags? Why do they appear when I use docker build?".In your case, if this was the first time your used
docker build
, this should not be a dangling image, but an intermediate one as I explained first in this answer.