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.

Docekr コマンド おさらい

Posted at

起動系のコマンド

DockerHubからイメージを取得
docker pull
取得したイメージからコンテナを作成
docker create
作成したコンテナを起動
docker start
image 取得、コンテナ作成、起動 をまとめて実行(上記3つをまとめて)
docker run

削除系

コンテナの削除
docker rm コンテナ名
コンテナの強制削除
docker rm -f コンテナ名

確認系のコマンド

コンテナ一覧を確認

現在実行中のコンテナを表示
docker ps
現在存在しているコンテナ一覧
docker ps -a

コンテナの詳細を確認

docker inspect コンテナ名

起動コンテナのshell接続

docker attach 起動中コンテナ名
docker exec -it 起動中のコンテナ名 /bin/bash

コンテナからimageの作成

コンテナからimageの作成
docker commit コンテナ名 image名:タグ名
イメージの変更履歴
docker history イメージ名

docker commit での image 作成は 履歴が残らないため、
Dockerfile から image の変更を行うことを推奨

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?