docker安装nginx
拉取nginx最新镜像
docker pull nginx:latest
运行容器
docker run --name vm-nginx -p 8080:80 -d nginx
安装验证成功
http://192.168.110.100:8080/
nginx dockerfile
dockerfile 内容
FROM nginx RUN mkdir -p /basicfinder/log/nginx/ && rm -rf /etc/nginx/conf.d/* # install vim && apt-get update && apt-get install -y vim # install ping && apt install -y iputils-ping COPY ./conf.d/v3nf.conf /etc/nginx/conf.d
build
docker build -t nginx:cible1.0 .
运行容器
docker run --name vm-basicfinder-v3nf-nginx -p 9080:80 -d -v /mnt/hgfs/basicfinder/v3nf-api:/basicfinder/www/v3nf.basicfinder.com/api --net vm-basicfinder-v3nf nginx:cible1.0