我创建了一些容器,它们还没有准备好使用,总是"重新启动"状态:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
02141a219070 debian "/bin/bash" 53 minutes ago Restarting (0) 3 minutes ago test
3a8b684011d4 debian "/bin/bash" About an hour ago Restarting (0) 4 minutes ago 10.140.10.151:443->443/tcp support-web.equifax.ru
ad40188569cd debian "/bin/bash" 4 hours ago Restarting (0) 25 minutes ago 10.140.10.150:443->443/tcp vpn.equifax.ru
没有执行官:
docker exec test / bin / bash
来自守护程序的错误响应:容器测试正在重新启动,等待容器运行
没有日志:
docker logs test
我用这种方式创建了容器:
docker run --name = test --restart = always debian / bin / bash
如何解决Docker问题?
答案 0 :(得分:5)
您需要以交互方式运行它。
docker run -ti --name=test --restart=always debian /bin/bash
-t, --tty=false Allocate a pseudo-TTY
-i, --interactive=false Keep STDIN open even if not attached