docker安装nginx

1、搜索nginx

docker search nginx

2、拉取nginx镜像库

docker pull nginx:latest

3、查看获取的镜像

docker images

4、启动容器:

docker run --name nginx -d -p 80:80 --privileged=true  -v D:/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v D:/nginx/conf/conf.d:/etc/nginx/conf.d -v D:/nginx/html:/usr/share/nginx/html -v D:/nginx/log:/var/log/nginx nginx:latest

容器卷挂载路径:
nginx.conf: /etc/nginx/nginx.conf
conf.d: /etc/nginx/conf.d
html: /usr/share/nginx/html
log:  /var/log/nginx

 

posted @ 2023-04-20 11:36  sowler  阅读(21)  评论(0编辑  收藏  举报