Suggest an editImprove this articleRefine the answer for “What is a layer in a Docker image?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **layer** in a Docker image is a part of the image that is created when each instruction in a `Dockerfile` is executed (for example: `FROM`, `RUN`, `COPY`). **Key point:** a layer is a separate, immutable piece of an image, created from a Dockerfile command, which Docker can cache and reuse.Shown above the full answer for quick recall.Answer (EN)ImageA layer in a Docker image is a part of the image that is created when each instruction in a `Dockerfile` is executed (for example: `FROM`, `RUN`, `COPY`). Each layer contains the file system changes that are added on top of the previous ones. ### **How to understand this at the junior level** - An image is built **like a cake made of layers** - one layer after another. - If you change one command, Docker **rebuilds only the corresponding layer** and takes the rest from the cache, which is why the build is fast. - All images reuse layers. For example, different images based on Ubuntu can **share a common base layer**, saving space. ### **Important properties of layers** | Property | Explanation | |---|---| | Read-only | A layer cannot be changed - only a new one can be added on top | | Cacheable | If a layer already exists, Docker does not rebuild it | | Shared | One layer can be used by many images | **In one phrase:** **A layer is a separate, immutable piece of an image, created from a Dockerfile command, which Docker can cache and reuse.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.