LOGBOOK

HELP

Quiz Entry - updated: 2026.11.10

Two containers run from the same image with a small web app (ports 9000 and 9001). A file is created through :9000/create. Can :9001/read show it? Why?

No. Each container has its own writable layer on top of the shared read-only image, so a file written in one container does not exist in the other.

Both containers start from identical image layers, but Docker gives each one a separate, private writable layer (copy-on-write). The /create request makes container intro1 write page.html into its layer. Container intro2 reads from its own layer and the unchanged image, where the file was never created, so /read reports that the file is missing.

You can confirm it from the host:

docker container exec intro1 ls   # page.html is listed
docker container exec intro2 ls   # page.html is not there

This filesystem isolation is what lets you create and remove containers without them affecting each other or leaving traces. It also means container data is ephemeral: deleting intro1 deletes page.html. Data that must be shared or must survive has to go into a volume or bind mount.

Two containers share the read-only image layers; the file page.html exists only in intro1's writable layer

* page.html lands in intro1's writable layer only. *

Go deeper:

From Quiz: ISLAB / Docker Introduction | Updated: Nov 10, 2026