基于CentOS学习docker笔记
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了基于CentOS学习docker笔记相关的知识,希望对你有一定的参考价值。
在nginx容器内编辑配置文件:将宿主的vi所在的目录挂载为容器的/bin
docker run -it -v /usr/bin:/bin nginx /bin/sh #vi /etc/nginx/nginx.conf
批量删除容器:
docker rm $(docker ps -a -q)
[[email protected] ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8e4ca9b36187 learn/ping "ping www.baidu.com" 23 hours ago Exited (0) 23 hours ago adoring_leavitt aaf15374785c learn/tutorial "apt-get install -y p" 24 hours ago Exited (0) 24 hours ago high_perlman 3cae0f4e0f90 learn/tutorial "echo ‘hello world‘" 24 hours ago Exited (0) 24 hours ago determined_mcnulty f0a26e9ce9a8 nginx:1.9 "nginx -g ‘daemon off" 38 hours ago Exited (0) 8 hours ago high_hodgkin a892ef304b92 nginx:1.9 "nginx -g ‘daemon off" 38 hours ago Created pedantic_northcutt [[email protected] ~]# docker rm $(docker ps -a -q) 8e4ca9b36187 aaf15374785c 3cae0f4e0f90 f0a26e9ce9a8 a892ef304b92 [[email protected] ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
以上是关于基于CentOS学习docker笔记的主要内容,如果未能解决你的问题,请参考以下文章
Docker学习笔记(99-1)Centos6.8上安装Docker