LoginSignup
1
0

More than 3 years have passed since last update.

Dockerはコンテナ内プログラムの終了ステータスもホスト側に渡してくれるよというお話

Posted at

タイトルの通りです。実際に確認してみましょう。
Pythonのコンテナを立ち上げて、終了ステータスを114に設定して終了させてみます。

$ docker run -it python  # pythonコンテナを起動
Python 3.7.3 (default, May  8 2019, 05:28:42) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit(114)  # 終了ステータスを114に設定してPythonを終了させる


$ echo $?  # 終了ステータスを見てみる
114

無事にホスト側で終了させるを確認してみると、114となっていますね。

1
0
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
1
0