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?

More than 5 years have passed since last update.

Dockerを扱う際のコマンドまとめ(ケースごと)

0
Posted at

徐々にデータを追加していきます

環境

Dockerそのものがわからんとき

command meaning note
docker --help dockerコマンドの内容

削除したいとき

| command | meaning | note |
|:-----------------:|:------------------:|:------------------:|:------------------:|
| docker image rm | 指定したを削除する | 複数のを指定可能(docker image rm ) , docker rmi はエイリアス|

一括削除したいとき

command meaning parent command note
docker system prune --all 使用されていない Container, Network, Image, Volumeが削除されます docker system
docker image prune 使用されていないImageが削除されます(なにかの都合で残ってしまったデータ、何にも紐付かないデータなどは削除されません) docker image
docker image prune --all 使用されていないImageが削除されます docker image
docker image rm $(docker images -q) 使用されていないImageが削除されます docker image

イメージをビルドしたりし直したりするとき

command meaning parent command note
docker-compose build Docker imageをフォアグラウンドでビルドします。
docker-compose up -d Docker imageが見つからない場合のみビルドしてから起動します。
docker-compose up -d --build Docker imageビルドしてから起動します。

動かしたいとき

command meaning parent command note
docker-compose up -d Docker imageをバックグラウンドでビルドします。イメージが見つからないときはビルドしてから動かします

その他覚えておくと良さそうなワード

word domain meaning examples note
prune 操作系コマンド 使われていない対象を一括削除する docker system prune, docker image prune
-q オプション 表示するデータを絞る docker images -q, docker image rm $(docker images -q)
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?