慕村9548890
查看当前系统中的容器列表1234[root@localhost ~]# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES1ce9f640478d 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重新启动一个容器12[root@localhost ~]# docker start ovcer_the_containerovcer_the_container查看该容器是否启动成功123[root@localhost ~]# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES1ce9f640478d ubuntu:latest "/bin/bash" 6 minutes ago Up 7 seconds ovcer_the_container使用该容器由于Docker容器重新启动的时候,会使用docker run命令时指定的参数运行,,所以容器重新启动后会运行一个交互式的会话shell可以使用下列命令 123[root@localhost ~]# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES1ce9f640478d ubuntu:latest "/bin/bash" 6 minutes ago Up 7 seconds ovcer_the_container