| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
1,029 バイト追加 、 2020年10月3日 (土) 04:27
| [[Docker]] | [[WSL]] | [[Kubernetes]]
==[[Docker コマンド]]==
| [[Docker]] | [[仮想化]] | [[Kubernetes]] |
{{amazon|B00JWM4W2E}}
*http://typea.info/blg/glob/2014/08/docker-commands.html
===コマンド===
{| class="wikitable"
|-
| docker pull nginx:latest
|-
! scope="row"| docker run -i -t -h | インタラクティブにshellを実行する例インタラクティブ実行
| docker run -i -t -h ubuntu ubuntu /bin/bash
|-
! scope="row"| docker run -d|バックグラウンド実行| docker run --name test-nginx -d nginx -p 8080:80 nginx
|-
! scope="row"| docker stop [コンテナID]|コンテナの停止| docker stop 5fe904cacaff
|-
! scope="row"| docker start [コンテナID]|コンテナが残っている場合、再実行できる| docker start 5fe904cacaff
|-
! scope="row"| docker exec|実行しているコンテナのコマンドを実行| docker exec -it 5fe904cacaff bash
|-
! scope="row"| docker inspect| オブジェクトのインスペクト(ipアドレスを調べるなど)| docker inspect 5fe
|-
! scope="row"| docker
|}
===runコマンドオプション===
{| class="wikitable"
|-
! scope="col"| コマンドオプション
! scope="col"| パラメータ
! scope="col"| 内容
! scope="col"| 例
|-
! scope="row"| -p, --publish
| hostPort:containerPort
| コンテナポートをホストに公開
| docker run --name test-ginx -d -p 8080:80 nginx
|-
! scope="row"| -v, --volume
| /host:/container
| ボリュームをバインド
| docker run --name bind-eginx -d -p 8080:80 -v /mnt/c/workspaces/docker/
nginx/content:/usr/share/nginx/html:ro nginx
|}
===バージョンの確認(version)===

案内メニュー