Vojtěch
Vojtěch

Reputation: 12416

Docker not starting, hard to debug

I am trying to start a docker image as follows:

docker run -i -t myimage:test

The image contains a mysql with /var/lib inside of the image. When the docker is run, it outputs this:

$ docker run -i -t myimage:test
2018-02-07T13:00:21.318700Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2018-02-07T13:00:21.337000Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2018-02-07T13:00:33.496999Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
$

It is very hard to see what is wrong in the image as one cannot enter and see the detailed logs. This is my image, I guess I have done something wrong during building it, but without logs, it is hard to find out what.

Upvotes: 0

Views: 94

Answers (1)

bluescores
bluescores

Reputation: 4677

docker exec might help you out. Just be sure the image is running. Alternatively you can pass a CMD override to the docker run like so: docker run -it myimage:test /bin/bash, but note this will override any existing CMD

Upvotes: 1

Related Questions