This question is for demonstrating docker and how it works, the following is the dockerfile content
FROM node:7
ADD node.js /node.js
ENTRYPOINT ["node", "node.js"]
and the node.js file is exist in the same directory, the question is why there is no intermediate container created for step#2?
~/demos/docker$docker build -t nodeapp .
Sending build context to Docker daemon 3.072kB
Step 1/3 : FROM node:7
7: Pulling from library/node
ad74af05f5a2: Pull complete
2b032b8bbe8b: Pull complete
a9a5b35f6ead: Pull complete
3245b5a1c52c: Pull complete
afa075743392: Pull complete
9fb9f21641cd: Pull complete
3f40ad2666bc: Pull complete
49c0ed396b49: Pull complete
Digest: sha256:af5c2c6ac8bc3fa372ac031ef60c45a285eeba7bce9ee9ed66dad3a01e29ab8d
Status: Downloaded newer image for node:7
---> d9aed20b68a4
Step 2/3 : ADD node.js /node.js
---> 44c4486c7b32
Step 3/3 : ENTRYPOINT ["node", "node.js"]
---> Running in c9291d1209b0
Removing intermediate container c9291d1209b0
---> cfb9beed3592
Successfully built cfb9beed3592
Successfully tagged nodeapp:latest
EDIT
For example see the following example from this lnk specifically this where COPY caused to create intermediate container
Step 4 : COPY package.json /usr/src/app/ ---> 334d93a151ee Removing
intermediate container a678c817e467
And from this link where
ADD Execute-MyCmdlet.ps1 c:\example\
resulted
Step 4/5 : ADD Execute-MyCmdlet.ps1 c:\example\ ---> a955b2621c31
Removing intermediate container b825593d39fc
So for ADD and COPY the instructions caused intermediate container to be created then removed.