dockerコマンド

 docker pull
 docker run
 docker images
 docker ps

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

 docker pull hello-world

docker images

 docker images
 
 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
 hello-world         latest              fce289e99eb9        2 months ago        1.84kB

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

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

ポート指定

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

コンテナの一覧 docker ps

 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]

 docker rm 0402

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

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

参考

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


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