Docker Community Forums

Share and learn in the Docker community.

Inheritance from parent image

(Asongbcbs) #1

I’m having trouble understanding what gets inherited from the parent image. When I use "FROM " in my Dockerfile, what exactly gets copied from the parent? Is it just the variables? Or does the parent actually get run?

My dilemma right now is that I want to make a few changes to an existing image but I can’t do that with an image I pulled from the public repos. Is there any other way to do this?

This is the image I’m using as my parent:
All I want is to add a few ADD and RUN lines to this image.

(Sam) #2

think of an image as a protected zip file. you cannot write to it, but can read from it…

docker build will read the contents and execute your run/add/copy… operations on the data
and make ANOTHER image (protected zip)…

sometimes you can make mods for run time by overlaying the folder with config files with others you source from external volume mounts… then you don’t change THE image.

i do this with my http server… the content path and config files are mounted from local host disk… the container cannot tell