New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change 'docker run' exit codes to distinguish docker/contained errors #14012
Conversation
We are basing this off of the "defacto" chroot standard. Bash has some rules around this also. |
looks ok for me. |
f6b3e71
to
52aabf2
Compare
Any word on this? |
6459251
to
9267e33
Compare
I think this is a good idea. Do you think we would break anyone relying on the existing error codes or do you think they are just checking for a non-zero return? |
I would doubt anyone would check on this, but if they were that would be a bug in their code. Currently you can not differentiate between docker errors and errors in apps in containers, so looking for exit code of 1 makes little sense. |
5c38be1
to
0698333
Compare
will this be considered before Docker 1.8? |
+1 makes sense. Moving to code review since @crosbymichael seemed to be ok with it as well. |
I counted two LGTM's, moving to docs review (but I'm not actually sure we have something around this, so suggestions are welcome) |
It's a good feature, I believe it should be documented indeed! |
@thaJeztah @icecrime in man/docker-run.1.md and docs/reference/run.md? I'm on it :) |
@@ -518,6 +518,38 @@ non-zero exit status more than 10 times in a row Docker will abort trying to | |||
restart the container. Providing a maximum restart limit is only valid for the | |||
**on-failure** policy. | |||
|
|||
## Exit Status | |||
|
|||
The exit code from `docker run` will give information about why the container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: s/will give/gives/
sgtm! I see you added to looks like this needs to be squashed and rebased as well (don't shoot the messenger! 😄) |
The purpose of this PR is for users to distinguish Docker errors from contained command errors. This PR modifies 'docker run' exit codes to follow the chroot standard for exit codes. Exit status: 125 if 'docker run' itself fails 126 if contained command cannot be invoked 127 if contained command cannot be found the exit status otherwise Signed-off-by: Sally O'Malley <somalley@redhat.com>
@thaJeztah done! |
thanks @sallyom. Man LGTM too. @thaJeztah can you check it out and merge if it looks good to you? |
Oh cool, it's updated, thanks!! LGTM \o/ |
Change 'docker run' exit codes to distinguish docker/contained errors
woohoo! |
/me waits for the world to burn with this one :) This is a good change though, I like having distinct exit codes. |
@sallyom thanks! and great job! |
As of Docker 1.10.0 ([#14012](moby/moby#14012)), the exit code for incorrect command-line arguments is 125.
As of Docker 1.10.0 ([#14012](moby/moby#14012)), the exit code for incorrect command-line arguments is 125.
As of Docker 1.10.0 ([#14012](moby/moby#14012)), the exit code for incorrect command-line arguments is 125.
close #6734
The purpose of this PR is for users to distinguish Docker errors from
contained command errors.
This PR modifies 'docker run' exit codes to follow the chroot standard
for exit codes.
Exit status:
125 if 'docker run' itself fails
126 if contained command cannot be invoked
127 if contained command cannot be found
the exit status otherwise
Signed-off-by: Sally O'Malley somalley@redhat.com