.nh .TH "DOCKER" "1" "Jan 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-d\fP, \fB--driver\fP="local" Specify volume driver name .PP \fB-h\fP, \fB--help\fP[=false] help for create .PP \fB--label\fP= Set metadata for a volume .PP \fB-o\fP, \fB--opt\fP=map[] Set driver specific options .SH SEE ALSO .PP \fBdocker-volume(1)\fP