简体   繁体   English

Docker容器立即退出

[英]Docker container exits immediately

I'm using docker v1.2 and having some issues starting a container. 我正在使用docker v1.2并且在启动容器时遇到了一些问题。 The container exits after the "docker run". 容器在“docker run”之后退出。 What's the best way to troubleshoot such issues? 解决此类问题的最佳方法是什么? Also are there major differences in running containers under AUFS and BTRFS? 在AUFS和BTRFS下运行容器也有很大差异吗?

You can run docker logs <container_name> to retrieve the logs 您可以运行docker logs <container_name>来检索日志

(if you don't know what was the container name, you can run docker ps -a to display all the containers) (如果您不知道容器名称是什么,可以运行docker ps -a来显示所有容器)

确保docker run命令中有-ti标志,否则docker容器将退出而不让你运行任何shell。

In my case the sa password was being rejected as too long. 在我的情况下,sa密码被拒绝的时间太长了。 I must have fumbled the setting at some point and the text following the setting had become "part of" the password. 我必须在某个时候弄乱了设置,设置后面的文字已成为密码的“一部分”。

Finding that out was an adventure. 发现这是一次冒险。 My iMac had the defaults - no development tools. 我的iMac有默认值 - 没有开发工具。 I downloaded: 我下载了:

bootstrap-4.0.0-alpha.t-dist 引导-4.0.0-alpha.t -距离

[Kitematic-Mac] [Kitematic-苹果]

Would a Mac person verify please? Mac会有人验证吗? I have a feeling there was a third download I needed. 我觉得我需要第三次下载。

Once I got Kitematic up and running it was easy to see the log and why the start failed from the Settings tab, General, Environment Variables, MSSQL_SA_PASSWORD. 一旦我启动并运行Kitematic,就很容易从“设置”选项卡,“常规”,“环境变量”,MSSQL_SA_PASSWORD中查看日志以及启动失败的原因。

Naive, but try.. 天真,但试试..

sudo service docker stop and then sudo service docker start sudo服务码头停止然后sudo服务码头启动

Then docker run the containers you were trying to. 然后docker运行您尝试的容器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM