Difference between revisions of "Docker volume create"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
https://docs.docker.com/engine/reference/commandline/volume_create/
 +
 +
 
  [[docker volume]] create --name YOUR_NEW_VOLUME_NAME
 
  [[docker volume]] create --name YOUR_NEW_VOLUME_NAME
  
  docker volume ls
+
  docker volume create --driver [[flocker]] -o size=20GB my-named-volume
 +
  --driver or -d (default local)
 +
 
 +
  [[docker volume ls]]
 
  DRIVER              VOLUME NAME
 
  DRIVER              VOLUME NAME
 
  local              34725c81eadc91a1c4602559ccf87bc465ab219796077fdc4ad462133924a25e
 
  local              34725c81eadc91a1c4602559ccf87bc465ab219796077fdc4ad462133924a25e
Line 8: Line 14:
 
  local              a226c877a27fb6001e4458cd707c345135eb3faf31218dc517131c9fdc627e3d
 
  local              a226c877a27fb6001e4458cd707c345135eb3faf31218dc517131c9fdc627e3d
 
  local              b32eb8976b66bcaaf3f2467beae7fc8a959e89f84e4b069c2e633a7ae0c3909
 
  local              b32eb8976b66bcaaf3f2467beae7fc8a959e89f84e4b069c2e633a7ae0c3909
 +
 +
 +
 +
It will create volume NEW_VOLUME_NAME if it does not exist
 +
* <code>[[docker run]] [[-v]] NEW_VOLUME_NAME:/path/inside/container -it alpine /bin/sh</code>
 +
 +
  
  
Line 14: Line 27:
 
* <code>[[docker run]]</code>
 
* <code>[[docker run]]</code>
 
* <code>[[docker volume inspect]]</code>
 
* <code>[[docker volume inspect]]</code>
 +
* <code>[[docker volume ls]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 09:54, 23 June 2020

https://docs.docker.com/engine/reference/commandline/volume_create/


docker volume create --name YOUR_NEW_VOLUME_NAME
 docker volume create --driver flocker -o size=20GB my-named-volume
 --driver or -d (default local)
docker volume ls
DRIVER              VOLUME NAME
local               34725c81eadc91a1c4602559ccf87bc465ab219796077fdc4ad462133924a25e
local               63168ff13648696d7df910fc81e5d9702631407febeb50d240625451d9eee84d
local               YOUR_NEW_VOLUME_NAME
local               a226c877a27fb6001e4458cd707c345135eb3faf31218dc517131c9fdc627e3d
local               b32eb8976b66bcaaf3f2467beae7fc8a959e89f84e4b069c2e633a7ae0c3909


It will create volume NEW_VOLUME_NAME if it does not exist

  • docker run -v NEW_VOLUME_NAME:/path/inside/container -it alpine /bin/sh



Related terms[edit]

See also[edit]

Advertising: