Images
What's a docker image?

Container Images Are Big
How overlays work
Basically:
Understanding Layering with Docker Images

The storage location of Docker images and containers
Here is an overview for the most used operating systems:
Use docker info | grep -i root command to findout:
docker info | grep -i root command to findout:Docker File

Lets take a look at sample Dockerfile:
Dockerfile Instructions
The generic syntax for the command is as follows:
The build process may take some time to finish:
Also to see layers which our image includes try docker image history <image id>:
docker image history <image id>:Listing Images
For listing local images, use the following syntax:
Pulling an image from default registry
To download a particular image, or set of images, use docker pull:
docker pull:Remove one or more specific images
When you’ve located the images you want to delete, you can pass their ID or tag to docker rmi:
docker rmi:For example lets remove debian image:
Remove dangling images
When you’re sure you want to delete them, you can use the docker images purge command:
docker images purge command:Tagging images
The two most common cases where tags come into play are:
If you need to push your image to a registry use docker build -t username/image_name:tag_name . :
docker build -t username/image_name:tag_name . :Notice how the tag is specified as optional here as well, by the [:TAG] :
[:TAG] :Storing images in Docker Registry
Examples of Docker Registries:
The first thing to remember is any time you are going to use a registry you need to first log in to that registry:
And when you finish your job, logout:
Pushing an image to the Default Registery
Use docker push to Push an image or a repository to a registry:
Searching for an image
And that is what docker search command does for us:
docker search command does for us:Docker search has a very useful filtering option, you can filter output based on these conditions:
Saving and loading images
Pushing to Docker Hub is great, but it does have some disadvantages:
For example, lets save a local copy of the myapp docker image we made:
myapp docker image we made:If we want to load that Docker container from the archived tar file in the future, we can use the docker load command:
Commiting changes to an image
For example let run a container based on nginx image:
Now lets attach to it and modify index.html:
And finally lets creating a new image from this running container using commit command:
And see the result:
Last updated