[docker] docker data management
1. Data volumes (bypass ufs layer, take effect immediately, and can be shared and reused)
-v /data
-v src:dst
docker run -it --name volume-test1 -h nginx -v /data centos
-it: keep it open, start tty
--name volume-test1:docker name is volume-test1
-h nginx: Specify host name as nginx
-v /data: Create a data volume
Find where container data is written:
docker inspect -f {{.Volumes}} volume-test1
Hang on to physical host directory to docker
docker run -it --name volume-test2 -h nginx -v /opt1:/opt2 centos
-v Source directory: Destination directory
Hang opt1 of the physical server in the opt2 directory of the docker container