Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.