$docker run ubuntu bash -c "exit 1"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c2c769c4b9ef ubuntu "bash -c 'exit 1'" 6 seconds ago Exited (1) 3 seconds ago happy_fermat
使用
原文链接:https://www.f2er.com/docker/436514.htmldocker inspect
模板:
$docker inspect c2c769c4b9ef --format='{{.State.ExitCode}}'
1