To create a volume using Docker Command Line make use of the docker volume create command,
Example:% docker volume create c_drive
c_drive

To see a list of all volumes created using the docker volume command, make use of the ls command,
Example:% docker volume ls
DRIVER VOLUME NAME
local c_drive
local d_drive
local e_drive
Note: If you use special characters other than a dot(.) or dash (-) you will get an error,
% docker volume create c:
Error response from daemon: create c:: "c:"
includes invalid characters for a local volume name,
only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed.
If you intended to pass a host directory,
use absolute path
This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!