Table of content
Basic command
- 查看 Docker 訊息
shell
docker info- 登入 hub.docker.com
shell
docker loginImage command
- 查看本地端以下載的 image
shell
docker images- 移除 image
shell
docker rmi -f {image ID} # -f 強制,直接將運行中的 container 刪除- 取得 container 的資訊
shell
docker inspect {ImageID}- 取得 image 的歷史紀錄
shell
docker history {ImageName}Containers Command
- 取得運行的 container
shell
docker ps -a- 運行 container
shell
docker run -it {imageName}- 取得該 container 的 log
shell
docker logs {CONTAINER}- 啟動 container
shell
docker start {ConatainerName}- 停止 container
shell
docker stop {ConatainerName}- 暫停 container
shell
docker pause <ConatainerName>- 取消暫停 container
shell
docker unpause {ConatainerName}- kill 運行中的 container
shell
docker kill {ConatainerName}- 移除 container
shell
docker rm {ConatainerName}- 進入 container
shell
docker exec -it {ConatainerName}