0

Many people know, what docker build and docker push are doing in general on a high level, but what do they exactly do on a low level?

let's say we have a Dockerfile like this

FROM alpine:latest
RUN touch ~/tmp
RUN touch ~/tmp2

this will create the delta filesystem (only changes) for each layer in /var/lib/docker/overlay2.

  1. layer contains a whole filesystem
  2. layer contains the file ~/tmp
  3. layer contains the file ~/tmp2

Open questions

  • What is the actual link between the layers? Is there a json, containing all the image info, including a sorted list of layers?

  • What kind of deliverable is generated to send it to the docker registry while performing docker push is it a tar.gz, similar to docker save

Flo
  • 2,699
  • 4
  • 24
  • 46

1 Answers1

0

From my point of view:

  • Each layer is transferred (only modified files add/update/deleted files instruction) to docker-registry.
  • Each layer know it's parent layer.
  • So when you pull down a child layer - it will pull parent layer hierarchy till the top(base layer).
  • Each layer is identified by identifiers (sha256 code and not by name).
  • Any change in the hierarchy will cause a different sha256 code-name for all the child image layers(even though there is no change in that layer).

Feel free to add or to suggest improvements.

fly2matrix
  • 2,351
  • 12
  • 13