10

我正在尝试运行这个 docker 示例。然而,我似乎无法启动我的 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

4

2 回答 2

5

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

于 2013-09-04T19:43:33.927 回答
0

有可能当你运行docker attch命令时,buildapp容器内的命令已经执行完毕,容器自动停止。如果您docker attach在运行命令后立即运行buildapp,您将看到它的输出。

于 2014-02-13T07:57:37.200 回答