[iyunv@web01 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1263f51d5bd1 nginx "nginx -g 'daemon off" 5 minutes ago Up 5 minutes 80/tcp, 443/tcp nginx-volumes
a04f5eee61b5 nginx "nginx -g 'daemon off" 15 minutes ago Up 15 minutes 443/tcp, 59.110.25.215:89->80/tcp dokcer-volumes
1f3d2f356995 nginx "nginx -g 'daemon off" 41 minutes ago Up 41 minutes 443/tcp, 59.110.25.215:88->80/tcp mynginx
[iyunv@web01 ~]# bash dockerin.sh 1f3d2f356995
root@1263f51d5bd1:/# cd /data
root@1263f51d5bd1:/data# ls
root@1263f51d5bd1:/data# touch test01 test02
root@1263f51d5bd1:/data# ls
test01 test02
root@1263f51d5bd1:/data#
4.linux本机查看
1
2
3
4
5
6
7
[iyunv@web01 volumes]# ll
total 0
-rw-r--r-- 1 root root 0 Jan 3 22:16 test01
-rw-r--r-- 1 root root 0 Jan 3 22:16 test02
[iyunv@web01 volumes]# pwd
/data/volumes
[iyunv@web01 volumes]#