Hi, this is more of a question than an issue.
Once I have a Container object of a container that exited ( possibly from client.run() ), how do I get the exit_code of that container? I looked at the documentation, it points me to container.status attribute, but it only gives a descriptive status of the container.
I can always do a subprocess.Popen and do this
docker inspect 61c6 --format='{{.State.ExitCode}}'
If the same data is available through something like container.exit_code it would be helpful.
Thanks :smile:
container.attrs['State']['ExitCode']
Make sure to call container.reload() first.
Thanks @shin- It works. Just a humble suggestion, may add this to documentation?
Closing this.
Most helpful comment
container.attrs['State']['ExitCode']Make sure to call
container.reload()first.