0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker ~exit とdetach(ctrl + q + p)の違い

Posted at

docker ~exit とdetach(ctrl + q + p)の違い

exitでコンテナから退出するとプロセスが終了する。
一般的な終了はexitで良さそう。
再度開始するには以下コマンド

docker restart id名 //ここでコンテナの起動
docker exec -it id名 bash //これでコンテナに入る

こうすると
docker ps -aをした時に
ステータスが
スクリーンショット 2020-12-02 15.31.26.png
だったものが
スクリーンショット 2020-12-02 15.31.29.png

に変更され起動を確認できる。

detachで退出した場合は
docker ps -aをした時に最初からUpのステータスになっている(コンテナは最初から起動されている)
ここのプロセスに入る際は

docker attach id名 //ここでコンテナに入る

で入れる

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?