1、安装
yum install docker service docker start systemctl start docker.service systemctl enable docker.service docker version
2、修改镜像
vi /etc/docker/daemon.json #添加后 { "registry-mirrors": ["https://registry.docker-cn.com"], "live-restore": true }
3、测试
docker pull library/hello-world docker images docker run hello-world
4、常用命令
docker pull image_name docker images docker rmi image_name/image_id docker ps // 正在运行的容器 docker ps -a // 所有容器 docker start container_name/container_id docker stop container_name/container_id docker restart container_name/container_id docker attach container_name/container_id docker rm container_name/container_id docker rm $(docker ps -a -q) // 删除所有的容器 docker info docker search image_name