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

Docker 基本コマンド一覧

Last updated at Posted at 2023-06-11

初めに

Dockerの基本コマンド一覧を備忘録として残します。

コマンド一覧

コマンド 効果
docker-compose ps コンテナを一覧表示、確認
docker-compose logs コンテナからの出力を表示
docker-compose up コンテナの作成と開始
docker-compose up -d バックグラウンドでコンテナ作成と開始(そのためログがターミナルに出力されない)
docker-compose stop サービスの停止(デスクトップアプリでも実行可能)
docker-compose start サービスの開始(デスクトップアプリでも実行可能)
docker-compose restart コンテナの再起動(デスクトップアプリでも実行可能)
docker-compose exec (service名) /bin/bash 起動しているコンテナにコマンドを実行するためのターミナルに入る

MySQLの操作
docker上のMySQLコンテナに入る

ターミナル
   $ docker-compose exec {サービス名} /bin/bash
サービス内のターミナル
   $ mysql -u root -h 127.0.0.1 --port ポート番号
   $ Enter password: パスワード

参考資料

公式ドキュメント

オプションについて

最後に

最後まで閲覧いただきありがとうございました。
ご意見、ご指摘ありましたら、コメントお願いいたします。

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