Linux Labs

Containers: Docker and compose / Stage 5 of 11

Volumes: data outlives the container

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 7 · summary · 2 min

Summary

  • Everything a process writes in a container goes into the container layer, and docker rm removes it together with the container.
  • A named volume (-v name:/path) lives apart from the container: every new container with the same -v sees the same files.
  • A host directory (-v /path:/path) is seen by the container as it is, and permissions on its files are checked against the UID of the process in the container.
  • The notes at the start of the lesson disappeared because they were in the container layer: docker rm removed them together with it.
Ubuntu 24.04
Loading…