1 回答
TA贡献1884条经验 获得超4个赞
查看当前系统中的容器列表
1 2 3 4 | [root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1ce9f640478d ubuntu:latest "/bin/bash" 5 minutes ago Exited (0) 14 seconds ago ovcer_the_container 8c342c0c275c ubuntu:latest "/bin/bash" 51 minutes ago Exited (0) 31 minutes ago sharp_bohr |
重新启动一个容器
1 2 | [root@localhost ~]# docker start ovcer_the_container ovcer_the_container |
查看该容器是否启动成功
1 2 3 | [root@localhost ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1ce9f640478d ubuntu:latest "/bin/bash" 6 minutes ago Up 7 seconds ovcer_the_container |
使用该容器
由于Docker容器重新启动的时候,会使用docker run命令时指定的参数运行,,所以容器重新启动后会运行一个交互式的会话shell
可以使用下列命令
1 2 3 | [root@localhost ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1ce9f640478d ubuntu:latest "/bin/bash" 6 minutes ago Up 7 seconds ovcer_the_container |
- 1 回答
- 0 关注
- 11587 浏览
添加回答
举报