I'm using docker v1.2 and having some issues starting a container. The container exits after the "docker run". What's the best way to troubleshoot such issues? Also are there major differences in running containers under AUFS and BTRFS?
-
1what are you trying to run? Usually, when the command finishes, the container does it fact exit as well. – Thilo Sep 25 '14 at 03:35
-
No the problem here is it doesn't run the command, it just abruptly exits. – Ananth Ravi Sep 25 '14 at 05:22
-
1docker run -i -t
bash – Ananth Ravi Sep 25 '14 at 18:14
5 Answers
You can run docker logs <container_name>
to retrieve the logs
(if you don't know what was the container name, you can run docker ps -a
to display all the containers)

- 10,214
- 4
- 32
- 36
-
this was a perfect idea! thank you. I'm new to docker and I didn't know I could use logs command to debug containers so easily – Tomáš Tibenský Jan 01 '16 at 19:43
-
This helped me address my issue. Once I viewed the logs, I could see that the container didn't have enough memory to run Java. – Bcf Ant Nov 16 '16 at 07:35
-
@theelee if `docker logs` doesn't show anything, it means there was no output. Using the `docker ps -a` command, you can see with which status code your container exited (`STATUS` column) – Céline Aussourd Jul 29 '20 at 12:56
-
-
@mLstudent33 That's your error. Check your Docker command (CMD) and your ENTRYPOINT. – Céline Aussourd Nov 27 '22 at 23:41
Make sure you have the -ti
flags in your docker run
command, otherwise the docker container will exit without letting you run any shells.

- 13,328
- 21
- 91
- 149
In my case the sa password was being rejected as too long. 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. I downloaded:
[Kitematic-Mac]
Would a Mac person verify please? 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.

- 343
- 5
- 8
Get this example as a base.
docker pull node
docker run -it node bash
That way -it means interactive and bash means that you'll access to run scripts inside a complete node container with: yarn, npm, and other features...

- 107
- 1
- 5
Naive, but try..
sudo service docker stop and then sudo service docker start
Then docker run the containers you were trying to.

- 3,029
- 2
- 13
- 6