moby: Docker commands should return nonzero error codes on failure
It would be good to do an audit of each command and ensure that all failure modes result in a nonzero exit status code.
I just noticed that a failed pull
has a 0 exit status.
$ docker pull foo/bar
Pulling repository foo/bar
Error: HTTP code: 404
$ echo $?
0
This is important when you’re trying to use docker programmatically. It’s not great to have to search for error messages in the output.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 6
- Comments: 16 (7 by maintainers)
Links to this issue
Commits related to this issue
- Remove zip dependency and replace with unzip equivalent (#354) — committed to rtyler/docker by garadox 8 years ago
@tianon Thanks! I had just installed the latest yesterday. The 0.8.0 version seems to fix it. That’s much easier than wrapping in a bash script like this: