dia
dia

Reputation: 51

dockerfile, log message dd108d5734de: Mounted from projecX

i'm new on building docker images, so my dockerfile is :

FROM node:10.16-alpine
WORKDIR /usr/src/app
COPY . ./
RUN npm install
ENV NODE_ENV=development
EXPOSE 8080
CMD ["npm", "start"] 

the build succed, but when i look to the log message i see :

dd108d5734de: Mounted from mcc/ProjectA
77306e58a4bd: Mounted from mcc/ProjectA
a3b85ad42b98: Mounted from mcc/ProjectB

and when i re-build again i have the message :

f1b5933fe4b5: Layer already exists
4cefe20ffcee: Pushed

i don't understead why it link my docker image with my other project (my current project has no relation with ProjectA and projectB) Does someone know why i have this log message ?

Upvotes: 0

Views: 165

Answers (1)

JongWon Lee
JongWon Lee

Reputation: 135

When the Docker image is built, the layers are created by executing the statements in sequence.

The generated layer is cached and reused if there is the same statements to build another image.

In this case, even if the project was different, it would have been reused because there was a locally cached layer.

Upvotes: 1

Related Questions