Docker Community Forums

Share and learn in the Docker community.

Clarification about dockerfiles specifying same FROM: source


(Sharbel) #1

Hello, I have a question that I can’t seem to find a definitive answer to. If I am developing a project with 3 micro services, each with their own docker file that specify in the FROM: line, the same image (eg: FROM microsoft/aspnetcore:2.0) will each container that is eventually started, each run an instance of the aspnetcore image? Or, does the docker just store 1 instance of the image, then spawn the 3 containers from the same image?

My understanding was that docker would use the base image and the 3 micro service containers would only be the ‘changes’ that were made for each micro service (ie: apt-get pulls and the files required for the micro services). However, when I execute ‘docker images’ I see 3 separate images displayed. Each of these images show up in the image list as being the same size as the base image (aspnetcore) which is ~300mb. Does this mean, that the docker host, for each aspnet microservice I create is being filled with an additional 300mb of image data (ie ~1gb) for 3 tiny microservices?

Thank-you in advance for any insight that can be provided!