tmp
Friday, December 25, 2015
Docker command
## Install * [CentOS](https://fiahfy.blogspot.jp/2015/12/install-docker-centos71.html) * [OSX](https://fiahfy.blogspot.jp/2015/12/mac-docker.html) ## Image ### Imageを取得 ```bash $ docker pull
``` ### 取得済みのImage一覧 ```bash $ docker images ``` ### Imageの削除 ```bash $ docker rmi
``` ###
なImageを全て削除 ```bash $ docker image prune ``` ### DockerfileからImageを作成 ```bash $ docker build -t IMAGE_NAME PATH ``` ## Container ### Run ```bash $ docker run IMAGE ``` ### Containerに名前をつけてRun ```bash $ docker run --name CONTAINER_NAME IMAGE ``` ### Backgroundで起動 ```bash $ docker run -d IMAGE ``` ### portの公開 ```bash $ docker run -p HOST_PORT:CONTAINER_PORT IMAGE ``` ### Link ```bash $ docker run --link CONTAINER_NAME:ALIAS IMAGE ``` ### 起動してbashでログインする ```bash $ docker run -it IMAGE bash ``` ### Containerが終了したら自動で削除する ```bash $ docker run --rm IMAGE ``` ### Start/Restart/Stop ```bash $ docker start CONTAINER $ docker restart CONTAINER $ docker stop CONTAINER ``` ### Remove ```bash $ docker run rm CONTAINER ``` ### Container一覧 ```bash $ docker ps -a ``` ## Network ### ls ```bash $ docker network ls ``` ### inspect ```bash $ docker network inspect
``` ### delete ```bash $ docker network rm
``` ### 未使用のネットワーク削除 ```bash $ docker network prune ```
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment