DEV Community


Posted on

Docker Image vs Docker Layer

Docker image is a static file that contains everything needed to run an application, including the application code, libraries, dependencies, and the runtime environment. It's like a snapshot of a container that, when executed, creates a Docker container.

A Docker image is composed of multiple layers stacked on top of each other. Each layer represents a specific modification to the file system (inside the container), such as adding a new file or modifying an existing one. Once a layer is created, it becomes immutable, meaning it can't be changed.

Docker Layer
The layers of a Docker image are stored in the Docker engine's cache, which ensures the efficient creation of Docker images.

Layers are what compose the file system for both Docker images and Docker containers.

It is thanks to layers that when we pull a image, you eventually don't have to download all of its filesystem. If you already have another image that has some of the layers of the image you pull, only the missing layers are actually downloaded.

Top comments (0)