Debug School

Manish Mishra
Manish Mishra

Posted on

Docker image

  • Docker Image is a collection of multiple Filesystems.
  • Each docker Image consist of 1 Root FS + 1 User FS which forms the Base Image and it can have multiple number of application specific FS.
  • Each of this Filesystem corresponds to a layer, and each layer are identified by a unique Layer ID.
  • Each of the Layers have a corresponding Parent layer except the root layer.
  • When a container is created, all of the layers defined in the images are merged into a single Mount which is then attached to the runtime user.
  • Once the container is running , any file related changes made into the container gets recorded in two location diff and merged.
  • diff directory is persistent, while the merged directory is removed when the container is stopped/killed.
  • If the stopped container is started back again a new merged is created from the layers defined in image and the changes from the diff directory is applied to that merged and is then mounted to the runtime user.
  • Docker Root Dir can be located by using docker info command.
  • Docker uses Sha2-256 algorithm to hash and manage the FS.
  • Depending on the Storage driver, the FS are created in the corresponding storage driver's name folder e.g. overlay2 under docker root directory.
  • The Meta data related to the container is stored under Image directory.

Top comments (0)