Skip to content

Why data in a volume survives docker rm

Select an icon to see what it is.

Step 1 of 6

Two files, two places

The container has a volume appdata mounted at /data. A file written to /data goes into the volume's directory. A file written anywhere else, like /tmp, goes into the container's own writable layer.

$ docker run -d --name tester -v appdata:/data alpine sleep 1000
PrevNext

Where /data/a.txt is stored

/var/lib/docker/volumes/appdata/_data/a.txt