Docker Nginx 搭建

在Docker库获取镜像

docker pull nginx

查看已经安装的镜像

docker images

HTTP

docker run --name nginx -d -p 80:80 -v /mnt/nginx/logs/:/var/log/nginx:rw -v /mnt/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -v /mnt/nginx/vhost/:/etc/nginx/vhost:ro -v /mnt/:/mnt/:ro -d nginx

SSL

docker run --name nginx -d -p 80:80 -p 443:443 -v /mnt/nginx/logs/:/var/log/nginx:rw -v /mnt/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -v /mnt/nginx/vhost/:/etc/nginx/vhost:ro -v /mnt/nginx/ssl/:/ssl:ro -v /mnt/:/mnt/:ro -d nginx

你可能感兴趣的:(Docker Nginx 搭建)