5.2. Creating Docker Volumes from Command Line

To create a new Docker volume from the command line, run

# docker volume create -d virtuozzo/ploop -o size=512G --name <volume>

To run a Docker container with the volume from the command line, run

# docker run -it -v <volume>:/<mount> alpine /bin/ash

Here <volume> is the volume name, e.g., MyVol, and <mount> is the path under which the volume will be available inside a container, e.g., /media/vol.

Note

For other operations on volumes, see man docker volume.