码迷,mamicode.com
首页 > 其他好文 > 详细

docker批量操作命令

时间:2016-08-22 23:54:31      阅读:554      评论:0      收藏:0      [点我收藏+]

标签:集群   registry   docker   

查看容器启动情况:

[root@docker redis203]# docker ps 
CONTAINER ID        IMAGE                                     COMMAND                  CREATED             STATUS              PORTS                                            NAMES
c1ab97816ca6        172.16.3.200:5000/tty/redis:3.0.5         "/usr/bin/supervisord"   12 minutes ago      Up 12 minutes       22/tcp                                           redis205
bf2146261891        172.16.2.250:5000/tty/redis:3.0.5    "/usr/bin/supervisord"   4 months ago        Up 3 hours          22/tcp                                           redis214
0754cbf81b8d        172.16.2.250:5000/tty/redis:3.0.5    "/usr/bin/supervisord"   4 months ago        Up 3 hours          22/tcp                                           redis209
b8051e9d081c        172.16.2.250:5000/tty/redis:3.0.5    "/usr/bin/supervisord"   4 months ago        Up 3 hours          22/tcp                                           redis208
14c51d1f54b7        172.16.2.250:5000/tty/redis:3.0.5    "/usr/bin/supervisord"   4 months ago        Up 3 hours          22/tcp                                           redis207
36e5247c6ec3        172.16.2.250:5000/tty/mysql:5.7.11-c6     "/usr/bin/supervisord"   5 months ago        Up 3 hours          22/tcp                                           mysql216
14b039ecf6d9        172.16.2.250:5000/tty/mysql:5.7.11-c6     "/usr/bin/supervisord"   5 months ago        Up 3 hours          22/tcp                                           mysql215
375836996cb7        deddb40463bf                              "/usr/bin/supervisord"   5 months ago        Up 3 hours          22/tcp                                           HSA-QUARTZ113
63b01608fb79        13fc4ed1ee19                              "/usr/bin/supervisord"   5 months ago        Up 3 hours          22/tcp                                           cas125
faae522514a0        fangcang/jenkins:1.651-c7                 "/usr/bin/supervisord"   5 months ago        Up 3 hours          22/tcp                                           jenkins187
ea9627543e82        registry                                  "docker-registry"        5 months ago        Up 3 hours          5000/tcp                                         registry250
1bbe6eb60112        shipyard/shipyard                         "/bin/controller serv"   5 months ago        Up 4 hours          0.0.0.0:8080->8080/tcp                           shipyard-controller
9b1e05f4b851        microbox/etcd                             "/bin/etcd -name disc"   5 months ago        Up 4 hours          0.0.0.0:4001->4001/tcp, 0.0.0.0:7001->7001/tcp   shipyard-discovery
8c59c0decafb        rethinkdb                                 "rethinkdb --bind all"   6 months ago        Up 4 hours          8080/tcp, 28015/tcp, 29015/tcp                   shipyard-rethinkdb
5754283665bf        172.16.3.200:5000/tty/redis:3.0.5         "/usr/bin/supervisord"   6 months ago        Up 26 minutes       22/tcp                                           redis204
2f28eaf6f00d        172.16.3.200:5000/tty/redis:3.0.5         "/usr/bin/supervisord"   6 months ago        Up 3 hours          22/tcp                                           redis202
0861e93aac20        172.16.3.200:5000/tty/redis:3.0.5         "/usr/bin/supervisord"   6 months ago        Up 3 hours          22/tcp                                           redis201

加参数 -a 可显示所有容器。docker images查看镜像。

启动、停止、查看日志

docker  start java210
docker  stop java210
docker logs redis205

进入容器:docker exec -it redis205 bash(netstat -tunpl)

批量操作:

docker images | grep none | awk ‘{print $3}‘|xargs docker rmi
docker ps -a | grep war|awk ‘{print $1}‘|xargs docker rm

查看网络:docker network ls

查看容器配置:docker inspect redis201

本文出自 “创者思” 博客,请务必保留此出处http://strongit.blog.51cto.com/10020534/1841108

docker批量操作命令

标签:集群   registry   docker   

原文地址:http://strongit.blog.51cto.com/10020534/1841108

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!