Docker Community Forums

Share and learn in the Docker community.

Docker volume create

(Cedrico2015) #1

I would like know what docker volume create does.
i tried to create an nfs volume from an unreachable host:
docker volume create --driver local \ --opt type=nfs \ --opt o=addr=,rw \ --opt device=:/var/nfs/general \ testvolume

i do docker volume ls, the volume is created.
docker volume inspect, i got: [ { "Driver": "local", "Labels": {}, "Mountpoint": "/var/lib/docker/volumes/testvolume/_data", "Name": "falsevolume", "Options": { "device": ":/var/nfs/general", "o": "addr=,rw", "type": "nfs" }, "Scope": "local" } ]
that means the volume has been created, without any prior verification…

I would have expected that the volume should not be created as the host is not reachable. But the error message is only displayed when i try to create a container that will mounted this volume.: docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/testvolume/_data': error while mounting volume with options: type='nfs' device=':/var/nfs/general' o='addr=,rw': no route to host..
Is it the normal design of the create command? how can a non existing volume being created?