mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-03 22:42:08 +00:00
rewrite the container, network chapters
This commit is contained in:
@@ -3,3 +3,15 @@
|
||||
|
||||
此外,当Docker容器中指定的应用终结时,容器也自动终止。
|
||||
例如对于上一章节中只启动了一个终端的容器,用户通过`exit`命令或`Ctrl+d`来退出终端时,所创建的容器立刻终止。
|
||||
|
||||
终止状态的容器可以用`docker ps -a`命令看到。例如
|
||||
```
|
||||
sudo docker ps -a
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
ba267838cc1b ubuntu:14.04 "/bin/bash" 30 minutes ago Exited (0) About a minute ago trusting_newton
|
||||
98e5efa7d997 training/webapp:latest "python app.py" About an hour ago Exited (0) 34 minutes ago backstabbing_pike
|
||||
```
|
||||
|
||||
处于终止状态的容器,可以通过`docker start`命令来重新启动。
|
||||
|
||||
此外,`docker restart`命令会将一个运行态的容器终止,然后再重新启动它。
|
||||
|
Reference in New Issue
Block a user