1、检查Docker信息 $sudo docker info 2、运行第一个容器 $sudo docker run --name 容器名 -i -t centos /bin/bash 新建容器基于centos基准镜像,将会从本地查找,找不到从互联网下载该镜像. docker run 新建镜像命令 -i-t 为支持标准输入STDIN,分配伪tty终端 /bin/bash将会能够看到容器内的shell eg、sudo docker run --name hello-world -i -t centos /bin/bash 3、删除一个或多个容器 docker rm 容器ID... 4、查看容器的详细信息 docker inspect 44fc0f0582d9 5、显示所有容器 docker ps -a 6、显示正在运行的容器 docker ps 7、启动一个或多个已被停止的容器 docker start 容器名 8、停止一个运行中的容器 docker stop 容器名 9、重启容器 docker restart 容器名 10、进入Docker容器 ####8214f935f4ea通过docker ps命令找到CONTAINER ID,推荐开发环境使用 docker attach 8214f935f4ea ####进入一个已经在运行的容器,推荐生产环境使用 docker exec -it 8214f935f4ea /bin/bash