bge0
bge0

Reputation: 921

Docker: does using FROM execute the entire base image?

Supposing I have a base image that does some execution of it's own: does including this using the

FROM: image:version

run all the commands in the original Dockerfile? I.e. even things like RUN, ADD, etc .

Upvotes: 2

Views: 269

Answers (1)

Andy
Andy

Reputation: 38287

No. The FROM command uses that image:version as the parent image (the pre-built snapshot of the file system). Your commands are then run on top of that.

However if the parent Dockerfile has ONBUILD RUN statements, those will be RUN as if they were present at the very top of your Dockerfile. Please see the Dockerfile docs

Upvotes: 4

Related Questions