docker/nginx/1.29.1/Dockerfile
yangyufans@126.com ebb72f34d9 nginx 1.29.1
2025-08-30 14:28:47 +08:00

37 lines
1.1 KiB
Docker

FROM centos:8
MAINTAINER Yang <yangyufans@qq.com>
ENV NGINX_VERSION=1.29.1
RUN cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
RUN sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g" /etc/yum.repos.d/CentOS-*
RUN sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
RUN yum clean all
RUN yum makecache
RUN yum install -y wget make gcc pcre-devel gzip zlib zlib-devel openssl openssl-devel
RUN echo "ZONE=Asia/Shanghai" > /etc/sysconfig/clock && \
rm -rf /etc/localtime && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN cd / && wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz \
&& tar -zxvf nginx-$NGINX_VERSION.tar.gz \
&& rm -rf nginx-$NGINX_VERSION.tar.gz \
&& cd nginx-$NGINX_VERSION \
&& ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream \
&& make \
&& make install
RUN mkdir -p /nginx/conf && mkdir /nginx/logs/ && mkdir /nginx/www
EXPOSE 80 443
COPY start.sh /
RUN chmod 777 /start.sh
CMD ["/start.sh"]