Skip to content

Instantly share code, notes, and snippets.

@hellokaton
Last active October 3, 2021 10:18
Show Gist options
  • Save hellokaton/8b02a88ba91567e6fde486379b1d9601 to your computer and use it in GitHub Desktop.
Save hellokaton/8b02a88ba91567e6fde486379b1d9601 to your computer and use it in GitHub Desktop.
docker常用命令

根据DockerFile构建容器

cd DockerFile所在目录
docker build -t 镜像名 .

查看所有容器

sudo docker ps -a

启动容器

sudo docker run -d 容器名

进入容器

sudo docker attach 容器名

停止容器

sudo docker stop 容器id

删除容器

sudo docker rm 容器id

删除本地镜像

docker rmi 镜像名
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment