• 追加された行はこの色です。
  • 削除された行はこの色です。
#author("2019-03-02T20:37:37+09:00","default:ryuichi","ryuichi")
#author("2019-03-03T17:31:25+09:00","default:ryuichi","ryuichi")
* dockerコマンド [#hf116748]

 docker pull
 docker run
 docker images
 docker ps

** イメージの取得 docker pull [image] [#g1ae5ddc]

 docker pull hello-world

** docker images [#c453e5b4]
 docker images
 
 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
 hello-world         latest              fce289e99eb9        2 months ago        1.84kB

** コンテナの実行 docker run [image] [#r8c2e7d8]

 docker run hello-world
 
 Hello from Docker!
 This message shows that your installation appears to be working correctly.
 ...

*** ポート指定 [#rf8a9ddf]

 docker run -p 80:80 kitematic/hello-world-nginx
   => http://localhost/
 docker run -p 5000:80 kitematic/hello-world-nginx
   => http://localhost:5000/


** コンテナの一覧 docker ps [#efa31e0e]

 docker ps
 docker ps -a   #stopしているコンテナも含める
 
 CONTAINER ID        IMAGE            COMMAND       CREATED          STATUS                     PORTS      NAMES
 0402f2964d5e        hello-world      "/hello"      2 minutes ago    Exited (0) 2 minutes ago              peaceful_colden

** コンテナの削除 docker rm [container] [#z2f249e8]

 docker rm 0402

** イメージの削除 docker rmi [image] [#gbfc0fd3]

 docker rmi fce2
 docker rmi -f fce2   # そのイメージを使ったコンテナがまだrmされてない場合

** 参考 [#oe49fb27]

http://docs.docker.jp/engine/reference/commandline/



トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS