Ananth Ravi
Ananth Ravi

Reputation: 727

Docker container exits immediately

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?

Upvotes: 41

Views: 61068

Answers (5)

Rafael
Rafael

Reputation: 131

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...

Upvotes: 1

Roy Latham
Roy Latham

Reputation: 373

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:

bootstrap-4.0.0-alpha.t-dist

[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.

Upvotes: 0

nachocab
nachocab

Reputation: 14364

Make sure you have the -ti flags in your docker run command, otherwise the docker container will exit without letting you run any shells.

Upvotes: 20

Sheetal Kaul
Sheetal Kaul

Reputation: 3277

Naive, but try..

sudo service docker stop and then sudo service docker start

Then docker run the containers you were trying to.

Upvotes: -5

Céline Aussourd
Céline Aussourd

Reputation: 10664

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)

Upvotes: 79

Related Questions