When a container exits, docker ps -a shows its exit code (scroll
docker ps -a
$ docker run ubuntu bash -c \"exit 1\" CONTAINER ID IMAGE COMMAND