惜风不起、唯有努力!
自定义nginx的dockerfile

自定义nginx的dockerfile

FROM centos:7
WORKDIR /usr/local/
ENV NG_VERSION nginx-1.21.0
RUN yum -y install epel-release.noarch &&\
    yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel &&\
    yum install -y pcre-devel libxslt-devel gd-devel GeoIP GeoIP-devel GeoIP-data &&\
    yum -y install ping curl wget net-tools
RUN yum clean all
RUN useradd -M -s /sbin/nologin nginx
ADD   nginx-1.21.0.tar.gz /usr/local/
WORKDIR /usr/local/$NG_VERSION
RUN ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module && make && make install
ENV PATH /usr/local/nginx/sbin:$PATH
EXPOSE 80/tcp
ENTRYPOINT ["nginx"]
CMD ["-g","daemon off;"]

发表回复

您的电子邮箱地址不会被公开。