小实验目的,通过volumes-from实现多个容器文件共享,有继承之意
1、运行dc01容器
docker run -it --name dc01 chengwen/centos
查看容器目录,并进入dataVolumeContainer2 新建文件 dc01_add.txt
[root@99ed34ced394 /]# ls -l
total 24
lrwxrwxrwx. 1 root root 7 May 11 2019 bin -> usr/bin
drwxr-xr-x. 2 root root 6 May 31 08:41 dataVolumeContainer1
drwxr-xr-x. 2 root root 6 May 31 08:41 dataVolumeContainer2
drwxr-xr-x. 5 root root 360 May 31 08:41 dev
drwxr-xr-x. 1 root root 62 May 31 08:41 etc
drwxr-xr-x. 2 root root 6 May 11 2019 home
lrwxrwxrwx. 1 root root 7 May 11 2019 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 May 11 2019 lib64 -> usr/lib64
drwx------. 2 root root 6 Jan 13 21:48 lost+found
drwxr-xr-x. 2 root root 6 May 11 2019 media
drwxr-xr-x. 2 root root 6 May 11 2019 mnt
drwxr-xr-x. 2 root root 6 May 11 2019 opt
dr-xr-xr-x. 177 root root 0 May 31 08:41 proc
dr-xr-x---. 2 root root 4096 Jan 13 21:49 root
drwxr-xr-x. 1 root root