Reputation: 1197
When I run a docker build command i see the following
[root@hadoop01 myjavadir]# docker build -t runhelloworld .
Sending build context to Docker daemon 4.096 kB
Sending build context to Docker daemon
Step 0 : FROM java
---> 3323938eb5a2
Step 1 : MAINTAINER priyanka [email protected]
---> Running in 89fa73dbc2b8
---> 827afdfa3d71
Removing intermediate container 89fa73dbc2b8
Step 2 : COPY ./HelloWorld.java .
---> 9e547d78d08c
Removing intermediate container ff5b7c7a8122
Step 3 : RUN javac HelloWorld.java
---> Running in d52f3093d6a3
---> 86121aadfc67
Removing intermediate container d52f3093d6a3
Step 4 : CMD java HelloWorld
---> Running in 7b4fa1b8ed37
---> 6eadaac27986
Removing intermediate container 7b4fa1b8ed37
Successfully built 6eadaac27986
Want to understand the meaning of these container ids like 7b4fa1b8ed37. What does it mean when the daemon says "Removing intermediate container d52f3093d6a3"?
Upvotes: 0
Views: 156
Reputation: 15082
The docker build
process automates what is happening in the Creating your own images section of the docker docs.
In your case above:
3323938eb5a2
(the ID of the java
image)89fa73dbc2b8
) to set the MAINTAINER
meta data, docker commits the changes and the resulting layer ID is 827afdfa3d71
89fa73dbc2b8
, we can remove itMAINTAINER
line, we create a new container to run the command COPY ./HelloWorld.java .
which gets a container ID of ff5b7c7a8122
, docker commits the changes and the resulting layer ID is 9e547d78d08c
ff5b7c7a8122
, we can remove itRepeat for steps 3 and 4.
Upvotes: 2