0
1

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 1 year has passed since last update.

Docker Desktopコンテナ自動起動の無効化

Last updated at Posted at 2022-12-28

コンテナの名前を「wordpress-db-1」とします。

# コンテナの情報を表示して、再起動設定の前後3行の情報を抽出
% docker inspect wordpress-db-1 | grep -3 RestartPolicy
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "always",    # 設定はここ
                "MaximumRetryCount": 0
            },

"Name":"always"は常に再起動という意味で、以下のコマンドで変更

# 再起動設定を変更
% docker update --restart=no wordpress-db-1
wordpress-db-1    # 正常に変更できた場合コンテナの名前が表示

変更されたかを設定情報で確認

% docker inspect wordpress-db-1 | grep -3 RestartPolicy
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },

"Name"が"no"に変更されていることを確認

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?