Dokcer常用命令

1.查看docker版本

docker -v

2.查看docker镜像

sudo docker images

3.运行名为ubuntu-puf的镜像

sudo docker run -itd --name ubuntu-puf ubuntu

4.进入名为ubuntu-puf的ubuntu镜像

sudo docker exec -it ubuntu-puf /bin/bash

5.遇到启动错误时"The container name xxx is already in use by xxx"

直接重启即可

sudo docker restart 镜像名

6.对docker容器进行重命名

使用docker rename命令

docker rename <原始容器名称> <新容器名称>

7.docker查看所有容器

docker ps -a

猜你喜欢

转载自blog.csdn.net/weixin_46841376/article/details/132838491