9
8

More than 5 years have passed since last update.

docker exec でコマンドが失敗しても 0 で終了する件

Last updated at Posted at 2014-11-07
$ docker exec $CID false
$ echo $?
0

この Issue の通り。実装は、難しくはないけど "boring" らしいのでいつ対応されるか。。。

とりあえずぼくはこうしたッス:

$ docker exec $CID /bin/bash -c 'false; echo $? > /tmp/return-code'
# false or some command to fail
$ test $(docker exec $CID /bin/cat /tmp/return-code) -eq "0"
9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8