我用以下命令创建了容器:
docker run -d -p 52022:22 basickarl/docker-git-test
以下是命令:
root@basickarl:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@basickarl:~# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e4ac54468455 basickarl/docker-git-test:latest "/bin/bash" 7 minutes ago Exited (0) 26 seconds ago adoring_lumiere
22d7c5d83871 basickarl/docker-git-test:latest "/bin/bash" 2 hours ago Exited (127) About an hour ago thirsty_wright
root@basickarl:~# docker attach --sig-proxy=false e4
FATA[0000] You cannot attach to a stopped container, start it first
root@basickarl:~# docker start e4
e4
root@basickarl:~# docker attach --sig-proxy=false e4
FATA[0000] You cannot attach to a stopped container, start it first
root@basickarl:~#
其实没什么可说的,我希望容器启动并保持运行。这是日志:
root@basickarl:~# docker logs e4
root@basickarl:~#
docker logs e4
说了什么? - kojirodocker start -ia $(docker ps -ql)
也会失败。你最好将该容器提交并启动一个新镜像。 - kojiro