infrastructure//Docker//volume

A Docker volume is a persistent bridge between the host and container file systems, created with `-v /host/path:/container/path`. Docker containers are ephemeral, and without volumes all data disappears when the container is removed; the mapping is bidirectional and live, so changes on either side are immediately visible on the other.


A Docker volume is a persistent bridge between the host and container file systems, created with -v /host/path:/container/path. Docker containers are ephemeral, and without volumes all data disappears when the container is removed; the mapping is bidirectional and live, so changes on either side are immediately visible on the other.

Volumes are critical for blockchain nodes, whose synced chain data (days of work) persists on the host through them. --data-path=/data/n1 tells Besu where to write inside the container, and -v ensures it reaches the host. Volumes are what reconcile the ephemeral container with the persistence a blockchain needs.