Docker Community Forums

Share and learn in the Docker community.

Meaning of exit codes


(Ctammes) #1

Is there any documentation about the meaning of the exit codes from the containers?
I also saw that the State/Error field is always (?) empty.


(Sven Dowideit) #2

Most of the time, the exit code should be the exit code of the (PID1) application that was running in the container.

[sven@t440s docker]$ bash
[sven@t440s docker]$ exit 13
exit
[sven@t440s docker]$ echo $?
13
[sven@t440s docker]$ docker run --rm -it debian 
root@8b32c92dc7ed:/# exit 13
exit
[sven@t440s docker]$ echo $?
13
[sven@t440s docker]$ docker run --rm -it busybox
/ # exit 13
[sven@t440s docker]$ echo $?
13

(Sven Dowideit) #3

I’ve also made https://github.com/docker/docker/pull/10508 - as you’re right, there was no documentation.