38
26

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 5 years have passed since last update.

Dockerコンテナ単体で自動起動の設定と確認を行う

Posted at

以下のオプションを使って自動起動の設定を変更できます。

有効化
docker update --restart=always [コンテナ名]
無効化
docker update --restart=no [コンテナ名]
自動起動が有効になっているコンテナを検索する
docker inspect -f "{{.Name}} {{.HostConfig.RestartPolicy.Name}}" $(docker ps -aq) | grep always
出力結果例
/container-1 always
/container-2 always
38
26
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
38
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?