Advanced Docker Usage
Volumes: Persistent Storage
Use volumes to store data that persists even after a container is removed. Here’s an example of running an Ubuntu container with a mounted volume from your local /tmp
directory:
docker run -it -v /tmp:/tmp ubuntu bash
You can view the volume by running the df
command inside the container.