.nh .TH "DOCKER" "1" "May 2024" "Docker Community" "Docker User Manuals" .SH NAME .PP docker-volume-create - Create a volume .SH SYNOPSIS .PP \fBdocker volume create [OPTIONS] [VOLUME]\fP .SH DESCRIPTION .PP Creates a new volume that containers can consume and store data in. If a name is not specified, Docker generates a random name. You create a volume and then configure the container to use it, for example: .EX $ docker volume create hello hello $ docker run -d -v hello:/world busybox ls /world .EE .PP The mount is created inside the container's \fB/src\fR directory. Docker does not support relative paths for mount points inside the container. .PP Multiple containers can use the same volume in the same time period. This is useful if two containers need access to shared data. For example, if one container writes and the other reads the data. .SH Driver specific options .PP Some volume drivers may take options to customize the volume creation. Use the \fB-o\fR or \fB--opt\fR flags to pass driver options: .EX $ docker volume create --driver fake --opt tardis=blue --opt timey=wimey .EE .PP These options are passed directly to the volume driver. Options for different volume drivers may do different things (or nothing at all). .PP The built-in \fBlocal\fR driver on Windows does not support any options. .PP The built-in \fBlocal\fR driver on Linux accepts options similar to the linux \fBmount\fR command: .EX $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 .EE .PP Another example: .EX $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 .EE .SH OPTIONS .PP \fB--availability\fP="active" Cluster Volume availability ("active", "pause", "drain") .PP \fB-d\fP, \fB--driver\fP="local" Specify volume driver name .PP \fB--group\fP="" Cluster Volume group (cluster volumes) .PP \fB-h\fP, \fB--help\fP[=false] help for create .PP \fB--label\fP= Set metadata for a volume .PP \fB--limit-bytes\fP=0 Minimum size of the Cluster Volume in bytes .PP \fB-o\fP, \fB--opt\fP=map[] Set driver specific options .PP \fB--required-bytes\fP=0 Maximum size of the Cluster Volume in bytes .PP \fB--scope\fP="single" Cluster Volume access scope ("single", "multi") .PP \fB--secret\fP=map[] Cluster Volume secrets .PP \fB--sharing\fP="none" Cluster Volume access sharing ("none", "readonly", "onewriter", "all") .PP \fB--topology-preferred\fP= A topology that the Cluster Volume would be preferred in .PP \fB--topology-required\fP= A topology that the Cluster Volume must be accessible from .PP \fB--type\fP="block" Cluster Volume access type ("mount", "block") .SH SEE ALSO .PP \fBdocker-volume(1)\fP