step1连接服务器
略
step2安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
systemctl start docker
step3配置镜像
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://kqh8****.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
step4第一个服务
docker run --name nginx-test -p 8080:80 -d nginx
你的nginx已经映射到8080端口了噢!