首页 > 代码库 > 基于CentOS学习docker笔记
基于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)
[root@localhost ~]# 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 [root@localhost ~]# docker rm $(docker ps -a -q) 8e4ca9b36187 aaf15374785c 3cae0f4e0f90 f0a26e9ce9a8 a892ef304b92 [root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
基于CentOS学习docker笔记
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。