Docker容器无法启动

时间:2013-09-04 19:28:58

标签: docker

我正在尝试this docker example。但似乎我无法启动我的docker容器。

sudo docker stop aff28c5dab3f
sudo docker start aff28c5dab3f
sudo docker ps
ID                  IMAGE               COMMAND             CREATED             STATUS              PORTS

sudo docker ps -a
ID                  IMAGE                     COMMAND                CREATED             STATUS              PORTS
aff28c5dab3f        shykes/pybuilder:latest   /usr/local/bin/build   26 minutes ago      Exit 0
52200b5c58a6        shykes/pybuilder:latest   /usr/local/bin/build   10 hours ago        Exit 0
b59e84340a7c        ubuntu:12.04              echo hello             11 hours ago        Exit 0
5c1bd5bc53d6        ubuntu:12.04              echo hello             12 hours ago        Exit 0

当我尝试跑步时 sudo docker attach aff28c5dab36,我看到Impossible to attach to a stopped container, start it first

2 个答案:

答案 0 :(得分:5)

我忘了附在容器上,因此收到了错误。我跑了sudo docker attach aff28c5dab36,现在一切正常。

答案 1 :(得分:0)

当您运行docker attch命令时,容器内的buildapp命令已经完成,容器会自动停止。如果在运行docker attach命令后立即运行buildapp,您将看到其输出。