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のコンテナーに入るコマンド

Last updated at Posted at 2022-01-15

docker exec

実行中のコンテナでコマンドを実行
docker exec -it コンテナID bashShell

例:docker exec -it ubuntu_bash bash

docker attach

実行中のコンテナにアタッチする
docker attach コンテナID
例:docker attach test

execとattach区別

  • execでコンテナに入り : 新しターミナル開くため、コンテナ停止せず、exitする
  • attachでコンテナに入り: 直接コンテナに入るため、コンテナを停止して、exitする
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?