拉取镜像
docker pull nginx
创建配置目录
mkdir -p /data/nginx/conf (nginx.conf)
mkdir -p /data/nginx/conf.d (default.conf,test.youliaoke.com.conf)
mkdir -p /data/nginx/html (index.html)
mkdir -p /data/nginx/logs
挂载运行
docker run -d --name nginx-server -p 8088:80 -v /data/nginx/html:/usr/share/nginx/html -v /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /data/nginx/conf.d:/etc/nginx/conf.d -v /data/nginx/logs:/var/log/nginx nginx
docker run -d --name nginx-server -p 8088:80 -v /home/cv/ROOT:/usr/share/nginx/html nginx
访问测试