Docker Community Forums

Share and learn in the Docker community.

Possible to see stdout and stderr when a container exits?

docker

(Littlesandra88) #1

Hello,

Let’s say my Dockerfile ends with RUN ['/run.sh'] and in that script I have made a typo, and therefore the container exits right away.

Is there a way I can get to see what stdout and stderr were when it exited?


(David Maze) #2

In this particular case, I don’t think Docker gets far enough for a stdout/stderr to have any content.

In general, though, you can run docker logs containername as long as the container still exists (you haven’t docker rm'd it), even if it exited.