Commandes Linux : docker volume create

DOCKER VOLUME CREATE

Commande : docker volume create
Usage:	docker volume create [OPTIONS] [VOLUME]

Create a volume

Options:
  -d, --driver string   Specify volume driver name (default "local")
      --label list      Set metadata for a volume
  -o, --opt map         Set driver specific options (default map[])

 

Créer un volume de type volume :

docker volume create volume

ou

docker volume create --name volume

ex :

$ docker volume create html
html
$ docker volume ls
DRIVER              VOLUME NAME
local               html
$ docker volume inspect html
[
    {
        "CreatedAt": "2018-10-17T00:32:22+02:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/html/_data",
        "Name": "html",
        "Options": {},
        "Scope": "local"
    }
]
$ sudo tree /var/lib/docker/volumes/
/var/lib/docker/volumes/
├── html
│   └── _data
└── metadata.db

2 directories, 1 file
$ docker volume create --driver local --opt type=tmpfs --opt o=size=100m logs
logs
$ docker volume inspect logs
[
    {
        "CreatedAt": "2018-10-17T03:30:15+02:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/logs/_data",
        "Name": "logs",
        "Options": {
            "o": "size=100m",
            "type": "tmpfs"
        },
        "Scope": "local"
    }
]

 

Fermer le menu
%d blogueurs aiment cette page :