其他
【这些都不知道你就是个弟弟】Docker常用命令
操作系统:CentOS Linux release 7.7.1908 Docker:19.03.2
[root@vostro harbor]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
11548ac31116 tomcat:9.0.26-jdk8-openjdk "catalina.sh run" 6 seconds ago Up 5 seconds 8080/tcp inspiring_ardinghelli
21c0499ccc76 nginx "nginx -g 'daemon of…" 29 minutes ago Up 29 minutes 80/tcp strange_zhukovsky
[root@vostro harbor]# docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 19
Server Version: 19.03.2
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
已经停止的容器; 未被使用的网络; 所有未打标签的镜像; 构建镜像时产生的缓存;
删除已经停止的容器:docker container prune 删除未被使用的网络:docker network prune 删除没有Tag的镜像:docker image prune 删除没有容器的镜像:docker image prune -a 删除未被使用的数据卷:docker volume prune
[root@vostro harbor]# docker ps -f id=11548ac31116
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
11548ac31116 tomcat:9.0.26-jdk8-openjdk "catalina.sh run" 4 minutes ago Up 4 minutes 8080/tcp inspiring_ardinghelli
[root@vostro harbor]# docker ps -f name=inspiring_ardinghelli
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
11548ac31116 tomcat:9.0.26-jdk8-openjdk "catalina.sh run" 7 minutes ago Up 7 minutes 8080/tcp inspiring_ardinghelli
按镜像名和TAG过滤:docker ps -f ancestor=tomcat:9.0.26-jdk8-openjdk 按镜像ID过滤:docker ps -f ancestor=4965bfab1881 按照镜像摘要信息过滤:docker ps -f ancestor=tomcat@sha256:67a9904e3ceb03abc50db7b374db7362f7e44d08a41488dd24c2bb14df8989a3
[root@vostro harbor]# docker ps --format "table {{.ID}}: {{.Image}}: {{.Names}}"
CONTAINER ID: IMAGE: NAMES
11548ac31116: tomcat:9.0.26-jdk8-openjdk: inspiring_ardinghelli
21c0499ccc76: nginx: strange_zhukovsky
[root@vostro harbor]# docker ps -f ancestor=tomcat:9.0.26-jdk8-openjdk -q
11548ac31116
[root@vostro harbor]# docker stop $(docker ps -f ancestor=tomcat:9.0.26-jdk8-openjdk -q)
11548ac31116
[root@vostro harbor]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
11548ac31116 tomcat:9.0.26-jdk8-openjdk "catalina.sh run" About an hour ago Exited (143) 43 seconds ago inspiring_ardinghelli
21c0499ccc76 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 80/tcp strange_zhukovsky
【目瞪口呆】通信机房内部长这样 分布式事务方案这么多,到底应该如何选型? Pandas中第二好用的函数 | 优雅的Apply
程序员因接外包坐牢 456 天!两万字揭露心酸经历 限时早鸟票 | 2019 中国大数据技术大会(BDTC)超豪华盛宴抢先看
阿里开源物联网操作系统 AliOS Things 3.0 发布,集成平头哥 AI 芯片架构!
雷声大雨点小:Bakkt「见光死」了吗?