Skip to content

Table of content ​

Basic command ​

  1. 查看 Docker 訊息
shell
docker info
  1. 登入 hub.docker.com
shell
docker login

Image command ​

  1. 查看本地端以下載的 image
shell
docker images
  1. 移除 image
shell
docker rmi  -f {image ID} # -f 強制,直接將運行中的 container 刪除
  1. 取得 container 的資訊
shell
docker inspect {ImageID}
  1. 取得 image 的歷史紀錄
shell
docker history  {ImageName}

Containers Command ​

  1. 取得運行的 container
shell
docker ps -a
  1. 運行 container
shell
docker run -it {imageName}
  1. 取得該 container 的 log
shell
docker logs {CONTAINER}
  1. 啟動 container
shell
docker start {ConatainerName}
  1. 停止 container
shell
docker stop {ConatainerName}
  1. 暫停 container
shell
docker pause  <ConatainerName>
  1. 取消暫停 container
shell
docker unpause  {ConatainerName}
  1. kill 運行中的 container
shell
docker kill {ConatainerName}
  1. 移除 container
shell
docker rm {ConatainerName}
  1. 進入 container
shell
docker exec -it {ConatainerName}

Built with VitePress