作者:洋索菲命_563 | 来源:互联网 | 2023-09-23 18:11
这是我的Dockerfile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| FROM centos
MAINTAINER salamander ********@qq.com
RUN yum install -y pcre-devel wget net-tools gcc zlib zlib-devel make openssl-devel
# 添加文件
ADD http://nginx.org/download/nginx-1.12.1.tar.gz
RUN tar -zxvf nginx-1.12.1.tar.gz .
RUN mkdir -p /usr/local/nginx
RUN cd nginx-1.12.1 && ./configure --prefix=/usr/local/nginx && make && make install
RUN rm -vf /usr/local/nginx/conf/nginx.conf
COPY ./nginx_conf /usr/local/nginx/conf/nginx.conf
# Expose ports
EXPOSE 80
CMD service nginx start |
我想设置Nginx实际的配置文件读取的位置为/home/www/docker/etc/nginx下
这个Dockerfile的路径是/home/www/docker下的