What is the difference between Docker Image and Layer?

Technology CommunityCategory: DockerWhat is the difference between Docker Image and Layer?
VietMX Staff asked 3 years ago
  • Image: A Docker image is built up from a series of read-only layers
  • Layer: Each layer represents an instruction in the image’s Dockerfile.

The below Dockerfile contains four commands, each of which creates a layer.

FROM ubuntu:15.04
COPY . /app
RUN make /app
CMD python /app/app.py

Importantly, each layer is only a set of differences from the layer before it.