yum updateyum install -y yum-utils device-mapper-persistent-data lvm2yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoyum list docker-ce --showduplicates | sort -ryum install docker-ce
加入启动
systemctl start dockersystemctl enable docker
验证安装完成
docker version
镜像安装目录
/var/lib/docker/image/
安装openresty
docker pull openresty/openresty#-v参数,冒号前为宿主机目录,必须为绝对路径,冒号后为镜像内挂载的路径;指定为只读可以用:rodocker run -d --name="nginx" -p 8080:80 -v /data/openresty/nginx/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro -v /data/openresty/nginx/logs:/usr/local/openresty/nginx/logs openresty/openrestydocker kill nginx && docker rm nginx