docker data volume loading using

docker provides three different ways of loading the data from the host into the container; volumes, bind mounts, tmpfs.
volumes: the management part docker host file system, the default position of the data volume (/ var / lib / docker / Volumes)
the bind mounts: can be stored anywhere in the host.
tmpfs: Mount stored in memory in the host system, and does not write the file system.

docker volume 子命令使用:
Commands:
create Create a volume
inspect Display detailed information on one or more volumes
ls List volumes
prune Remove all unused local volumes
rm Remove one or more volumes

Create a data volume test_date : docker volume create test_date
docker data volume loading using
view data volume details : docker volume inspect test_date
docker data volume loading using
create a container, using this data volume : docker container run -itd --name nginx- test --mount src = test_date, dst = / usr / share / nginx / html nginx : 1.11
docker data volume loading using
second method using the -v option : docker container run -itd -p 8081: 80 --name nginx-test2 -v test_date: / usr / share / nginx / html nginx: 1.11
docker data volume loading using
cleanup data volumes: pause container, remove the container, and then delete the data volume
Docker nginx-STOP the Test container
Docker container RM nginx-the Test
Docker volume RM test_date

Guess you like

Origin blog.51cto.com/8922100/2480748
Recommended