1.

What is docker image?

Answer»

A Docker image is an executable file, that creates a Docker container. An image is built from the executable version of an APPLICATION together with its dependencies and configurations. Running instance of an image is a container.

Docker image includes system libraries, tools, and other files and dependencies for the application. An image is made up of multiple layers. Layered structure helps the developers to reuse ALREADY available static image layers from the Docker Hub, for different projects. This saves the developers time. Each image has a base LAYER which could be already available in Docker Hub or built from scratch. Then a readable/writable layer over the static layer is created that helps to customise the container. Each layer of the docker image could be verified in /var/lib/docker/aufs/diff, or via the Docker history command.

Storage drivers are used to managing the image layers. A writable layer created while creating the container is called the container layer. Multiple containers can share the same base layer and have their own writable layer. Few commands that can be used with images are:

  • docker history shows the history of an image and its layers.
  • docker UPDATE helps to update the container configurations.
  • docker tag creates a tag for the container and ORGANIZES container images.
  • docker search looks for the image in Docker Hub
  • docker save allows saving of images.
  • docker rmi removes one or multiple images.


Discussion

No Comment Found