1.查看容器
| [root@centos201 ~] |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 6aab26123615 nginx:1.16 "nginx -g 'daemon of…" 52 seconds ago Up 51 seconds 80/tcp dazzling_heisenberg |
| [root@centos201 ~] |
| |
| |
| [root@centos201 ~] |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| cdfe54e8192b centos:7 "/bin/bash" 9 seconds ago Exited (0) 8 seconds ago great_payne |
| 6aab26123615 nginx:1.16 "nginx -g 'daemon of…" 54 seconds ago Up 53 seconds 80/tcp dazzling_heisenberg |
| 8b4f7ae36b6e nginx:1.14.2 "nginx -g 'daemon of…" 3 minutes ago Exited (0) 2 minutes ago clever_jones |
| [root@centos201 ~] |
| |
| |
| [root@centos201 ~] |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| f2bebb69d4a1 centos:7 "/bin/bash" 30 seconds ago Up 29 seconds test |
| [root@centos201 ~] |
2.运行容器
| [root@centos201 ~] |
| 6aab2612361572634a88312c413fb8aedae47951589cf7551d739a54f90e1205 |
| |
| [root@centos201 ~] |
| |
| |
| [root@centos201 ~] |
| 6aab2612361572634a88312c413fb8aedae47951589cf7551d739a54f90e1205 |
| [root@centos201 ~] |
| |
| [root@centos201 ~] |
| [root@5338d7542d32 /] |
| [root@5338d7542d32 /] |
| anaconda-post.log bin dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var |
| [root@5338d7542d32 /] |
| [root@5338d7542d32 /] |
| / |
| [root@5338d7542d32 /] |
| [root@5338d7542d32 /] |
| exit |
| [root@centos201 ~] |
| |
| |
| [root@centos201 ~] |
| f2bebb69d4a119e4e2d5a222dfe730a345b8b21d5e6d9c26d9dffb5d48dcc776 |
| [root@centos201 ~] |
| |
| |
| [root@centos201 ~] |
| 732ac37a5f72f6ccc47a9593a84298dfab8bee65ed62688159cdbff963005b28 |
| [root@centos201 ~] |
3.连接到指定容器
| [root@centos201 ~] |
| [root@f2bebb69d4a1 /] |
4.删除所有容器
| docker container rm -f `docker container ps -qa` |
5.查看容器的IP地址,查看IPAddress字段即可
| docker container inspect 容器名称|容器的ID |
| docker container inspect `docker container ps -lq` |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通