如何继续停泊码头 [英] How to continue a docker which is exited

查看:93
本文介绍了如何继续停泊码头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

docker run -t -i centos /bin/bash



<我按ctrl-d退出它。

I pressed 'ctrl-d' to exit it.

我想继续运行这个容器,但是我发现我不能。
唯一的方法是

I want to continue run this container, but I found I can't. The only method is

docker commit `docker ps -q -l` my_image
docker run -t -i my_image /bin/bash

我是对的吗?有什么更好的方法吗? (我使用docker 0.8.0)

Am I right? Is there any better method? (I'm using docker 0.8.0)

推荐答案

您可以在退出之后重新启动现有容器,并且您的更改仍然在

You can restart an existing container after it exited and your changes are still there.

docker start  `docker ps -q -l` # restart it in the background
docker attach `docker ps -q -l` # reattach the terminal & stdin

这篇关于如何继续停泊码头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆