How to create volume in Docker using Command


docker volume create command

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
-


Have Questions? Post them here!

Top Hashtags: