补充退出但不关闭容器方法.

Signed-off-by: ithink.chan <chenyang@autoai.com>
This commit is contained in:
ithink.chan 2020-01-06 13:27:01 +08:00
parent 790d7ade3a
commit 6aac4d9cf8
1 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,7 @@ docker run --net=<bridge/host/container:container name or id/none> -it -v <host
docker ps docker ps
# 提交针对某容器的修改,将其保存为镜像 # 提交针对某容器的修改,将其保存为镜像
docker commit <container id> <repository>:<tag> docker commit <container id> <repository>:<tag>
# 退出容器:在容器的 shell 中直接 # 退出并关闭容器:在容器的 shell 中直接
exit exit
# 运行某已存在的容器 # 运行某已存在的容器
docker start <container id> docker start <container id>
@ -63,6 +63,8 @@ docker export -o <tar file> <container name/id>
docker import <tar file> <repository>:<tag> docker import <tar file> <repository>:<tag>
``` ```
想要退出但不关闭容器,在容器中按下 Ctrl + P + Q 组合健即可.
如果想退出容器但又不想让容器停止,使用 ctrl+p+q 即可。 如果想退出容器但又不想让容器停止,使用 ctrl+p+q 即可。
### 容器操作 ### 容器操作