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?

【Docker Compose】起動と停止

Last updated at Posted at 2025-04-04

起動

docker compose up -d --build

Docker Compose を使用してコンテナをビルドし、バックグラウンドで起動するためのコマンドです。このコマンドの各部分を詳しく解説します。

コマンドの構成

up

定義されたサービス(コンテナ)を起動します。
必要に応じて、イメージをビルドし、ネットワークやボリュームを作成します。

-d

オプション。バックグラウンドモードでコンテナを起動します。
このオプションを指定しない場合、ログがターミナルに表示され続けます。

--build

オプションコンテナを起動する前に、Docker イメージを再ビルドします。
Dockerfiledocker-compose.yml に変更があった場合に使用します。

停止

docker compose down

Docker composeで管理するコンテナを停止させるためのコマンド

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?