We have just successfully pulled two different images from Docker Hub, and those images are Hello World
and BusyBox.
And basically now we are ready to create new containers from those images.
But before doing that, let me explain you structure of every image and explain you actually key points
about images in a nutshell.
Every image is simply a set of files.
That's the simple.
And when you pull image from remote registry like Docker Hub, you download simply a set of files and
folders.
That's the simple.
But every image is actually splitted into different file system layers or shortly layers.
And you may ask me what is the reason for splitting images into multiple layers?
Answer is very simple.
Using such splitting approach, we are able to reuse different layers in different images.
For example, let's say that there is an image that has PHP installed in it and now you want to create
image that will be running WordPress.
You probably know that WordPress uses PHP and if you create WordPress image, you could reuse layers
in the PHP image and add additional layers that will install WordPress and run it afterwards.
That's reusability of different layers.
Also, every image has so-called base image.
For example, base image could be BusyBox or Alpine or Ubuntu or Samsung Girls.
And on top of that base image you are able to add additional layers like in this example layer one.
Then on top of layer one, you add additional layer two image and next you will add additional layer
three image and different images may have different quantity of layers.
Some simple images may have just 1 or 2 layers.
More complicated images may have tens of different layers.
All right.
Let me now talk about key points about Docker image.
First of all, Docker image is read only.
You are not able to modify existing Docker image.
It is not possible at all.
But you are able to create custom image based on other image.
If you want.
And if we will get back to images that we have already pulled from Docker Hub, Hello World and BusyBox,
you are not able to modify those images.
You are able just to create containers based on those images or create other images based on those images.
Next.
As I have already told you, every image consists of multiple file system layers and there could be
one, two, three tens, hundreds of different layers as much as you want.
Next images could be stored in a private or public repositories, and we have actually used the public
repositories for Helloworld and BusyBox images and those repositories are available at Docker Hub Public
Registry.
But you are also able to create private repositories if you create some proprietary images and that
your company only uses next images could be copied, deleted or moved.
And actually in the previous lecture we have simply copied images from remote server to our local computer.
And in the same way you are able to copy images from your computer and move it to other computer if
you want to.
Because every image, again, is simply a set of files.
But during download process you may have noticed that we were pulling different layers and actually
when you pull image from remote repository from remote registry, then you are pulling archived layers.
And if for example, image has three different layers, then you'll download three different archives.
It is done for optimization of bandwidth usage and afterwards on your local computer, Docker will extract
contents from those archives.
All right.
Next, you are able to use official or community images.
And in the previous lecture, Hello World and BusyBox images were official images.
And if I'll go back to Docker Hub here, you'll see that Hello world is Docker official image.
But if I'll type, for example, let's say PHP.
You'll see that there is also a PHP official image available.
But if I'll scroll a bit down, you'll see such images as phpMyAdmin slash, phpmyadmin, php, docker
IO slash PHP 73 FPM and those images are community images.
They were created by specific users.
This image was created by phpMyAdmin user, this by PHP, docker user, and so on.
Again, there are official images and community images.
You of course able to use either official images or community images as long as they are publicly available.
All right.
That's what I wanted to tell you about Docker images.
And key point here is that every image is read only you are not able to modify image.
And second key point is that every image consists of multiple file system layers and every file system
layer is simply a set of files and folders.
All right.
That's all for image structure overview.
And next, let's proceed and let's try to create first container based on Hello World image.
I'll see you in the next lecture, guys.
Bye bye.