Docker volume create size?

hi,

ive search high and low for proper docker volume options when creating one.
it keeps bugging me for device option, but i can never find any documentation or example indicating the right device value to set. I’am using macos.

i needed to set the size due to the default limitation.
ive even tried to configure the default setting in docker ui, with this:

{
  "debug" : true,
  "experimental" : true,
  "storage-opts": [
    "dm.basesize=100G",
  ],
}

and it didnt work. volume still default to like 19G

i tried:

docker volume create --opt type=aufs --opt o=size=100G,uid=501 --opt device=/var/lib/docker/aufs myvolume

it complaints device not found

also tried this with similar result:

docker volume create --opt type=overlay2 --opt o=size=100G,uid=501 --opt device=test myvolume

anyone know the right parameter for “device” option?
or anyway to set volume storage size without the need to specify any type?
ive tried without type, but the size does not reflect

The default Docker volumes are really “just directories” on the host and aren’t intrinsically size-limited. I don’t think there’s a docker volume create option to specify (or limit) the size.

Using Docker Machine, or Docker for Mac? (Is there a whale icon in the menu bar?)

In either case there is a Linux virtual machine involved. It feel like Docker for Mac has a fairly flexible storage system, but for Docker Machine using VirtualBox, the default is for the root disk to be 20,000 MB. That 20 GB is shared across all images, containers, and volumes. If that’s a problem, you can delete and rebuild the VM; the relevant options are pretty prominent in docker-machine --help.

hi @dmaze

thank you for helping.
no, it seems on my machine, creating a volume without size specification will seems to have limit of 19 or 18GB.

is this due to my storage balance on my machine?
how do i force it to be 100G or more?
im using default vm that comes with docker on mac, not using virtualbox

just found out my docker is still using qcow format.
i did a data reset and factory reset, now ive the right disk space balance according to the allocated size in the docker preference.

hmmm