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 command 覚書

Last updated at Posted at 2025-01-28

Dockerコマンド覚書

docker psで出力される内容

Dockerのdocker psコマンドは、現在実行中のコンテナの一覧を表示するためのコマンドです。

出力内容
docker psコマンドを実行すると、通常以下のような情報が表示されます。

CONTAINER ID: コンテナの一意な識別子
IMAGE: コンテナが基づいているイメージ名
COMMAND: コンテナ内で実行されているコマンド
CREATED: コンテナが作成された時刻
STATUS: コンテナの状態(Up、Exitedなど)
PORTS: コンテナに公開されているポート
NAMES: コンテナ名

Container名のみ表示したい時

Container名に"hogehoge"を含むcontainerの名前リストが出力される。

% docker ps --format '{{.Names}}'

出力例

my_web_app
my_db

すべてのコンテナのコンテナ名を表示

docker ps -a --format '{{.Names}}'

停止中のコンテナのコンテナ名を表示

docker ps --filter="status=exited" --format '{{.Names}}'
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?