3
2

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 よく使うコマンドまとめ

Last updated at Posted at 2018-12-22

よく使うコマンドだけです。

ダウンロードして(バックグラウンドで)起動

ついでにオプションで名前も追加

$ docker run -itd --name [container-name] ubuntu

起動のコンテナを確認

$ docker ps

起動していないコンテナも確認

$ docker ps -a

ログイン

$ docker exec -it [container-name] /bin/bash

停止

$ docker stop [container-name]

起動(2回目以降)

$ docker start [container-name]

コンテナの削除

$ docker rm [container-name]

イメージの削除

$ docker rmi ubuntu

イメージの作成

$ docker commit [container-name] [test-user/hello]

[test-user/hello]の場所がイメージの名前

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?