1、下载:docker pull nginx
2、创建目录,如下图
3、复制挂载文件
docker cp dbc:/etc/nginx/nginx.conf D:\ls\nginx\
docker cp dbc:/etc/nginx/conf.d D:\ls\nginx\conf\
docker cp dbc:/usr/share/nginx/html/ D:\ls\nginx\html\
docker cp dbc:/var/log/nginx/ D:\ls\nginx\logs\
4、启动
docker run
-p 9001:80
--name nginx
-v D:\ls\nginx/conf/nginx.conf:/etc/nginx/nginx.conf
-v D:\ls\nginx/conf/conf.d:/etc/nginx/conf.d
-v D:\ls\nginx/log:/var/log/nginx
-v D:\ls\nginx/html:/usr/share/nginx/html
-d nginx:latest