This Works
To create the docker volume without specifying the disk size:
docker volume create disk1
To mount the volume(disk1) to a container
docker run -itd -v disk1:/data ubuntu
This is Not Working
Now creating the docker volume by specifying a size of 100mb
docker volume create --name disk2 --opt o=size=100m
To mount the volume(disk2 which is of size 100 MB) to a container
docker run -itd -v disk2:/data ubuntu
when I run these commands I was getting the following error
docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/disk2/_data': missing device in volume options.