To create a volume using Docker Command Line make use of the docker volume create command,
Example:% docker volume create c_drive
c_drive
![docker volume create command docker volume create command](https://code2care.org/docker/create-volume-docker-using-command/images/docker volume create command.jpg)
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
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to Docker,
- Install Docker on Mac using brew cask
- How to know the Docker Sandbox ID of a Container Network?
- How to Rename Docker Image with none TAG and REPOSITORY?
- How to know list of images available on your device
- Docker Alpine Linux and Apache2 Example
- Install Bash on Alpine Linux - Docker
- Docker Run Command Examples - Part 1
- Install the minimal Linux on Docker (only 5 mb Alpine Linux)
- [fix] docker: Error response from daemon: dial unix docker.raw.sock: connect: no such file or directory.
- Install RabbitMQ on Docker
- How to know docker Engine details
- [Fix] Docker Error response from daemon: manifest for :latest not found: manifest unknown
- How to stop and start a docker container
- How to create volume in Docker using Command
- How to know the Docker Engine Version
- [docker] Error response from daemon: No such container
- Install Docker for Mac using Home-brew Cask
- Docker - Incompatible CPU detected - M1/M2 Mac (macOS Sonoma)
- [fix] Docker Desktop App not starting on Mac (macOS)
- Unable to find image docker latest locally
- How to Stop/Cancel/kill docker image pull
- List of what's new in Docker 4.23
- [Docker M1/M2 Mac] qemu-x86_64: Could not open /lib64/ld-linux-x86-64.so.2: No such file or directory AWS CLI
- Install Docker Desktop on M1/M2 Apple Silicon ARM Chip Mac
- Docker - Running in Resource Saver mode
More Posts:
- Fetch only content-type using cURL Command - cURL
- Program 12: Calculate Area and Circumference of Circle - 1000+ Python Programs - Python-Programs
- How to check your installed version of Git - Git
- Create Symbolic Link using Terminal Command - MacOS
- Xcode 13 - unknown error compiling for iOS 15.0 but module has a minimum deployment target of iOS 15.2 - iOS
- Accept Only 0-9 Numbers RegEx Example - HowTos
- How to Run PowerShell Script (.ps1) on Mac - MacOS
- Shortcut: How to delete a complete line in Nano Editor - Linux