what’s volume in docker
content
volumeis a way to persist and share container data across lifecycles- it’s basically a way to store data outside of containers
Example:
docker run -v /mnt/data:/data my-image- this command run a container from
my-image, mounting/datain the container to/mnt/dataon the host machine - whatever the container writes to
/datais written to/mnt/dataon host machine