Docker Community Forums

Share and learn in the Docker community.

Question about creating images from images


(Meisterlampe) #1

Hi,

Im new to docker and i have some questions about understanding images.

For example:

  1. I pulled the latest ubuntu image. (ubuntu:latest) (Virtual size 188 MB)

  2. I started a container of this image and installed some stuff (for example some servers, mysql etc) (Virtual size 1GB)
    3)= I pushed my container to my registry (lets name it ubuntu:base)

  3. Now i pull my ubuntu:base, start a container and deploy some stuff to the servers and commit it to my registry as ubuntu:version1 (Virtual size now 1.2GB)

  4. Now i start a container of my ubuntu:base again and deploy some newer stuff to the servers and commit it to my registry as ubuntu:version2 (Virtual size 1.2 GB)

When i am now on an other machine and i pull first ubuntu:version1 he will download 1,2GB
When i now pull ubuntu:version 2 does he download the diff between base and version2 or does he download the full version2 image with 1,2 GB ?

I was thinking about creating images with my buildserver where i store the build releases of my application, so that i can just pull the newest image on my server and start the container.

Thanks alot and best regards,
meisterlampe


(Kaleeswaran Narayanan) #2

@meisterlampe , At first time you pulled the base image [ ubuntu:base ] it pulls each and every layer related to that image. After you pulled [ ubuntu:base1 ] it pulls just difference between base and base1 . AUFS is the technology does this work . So, you no need to worry about the size of the image .

Thanks.
Kaleeswaran N