From ebb72f34d96a72cffe5a2f3fb0afca3906f46f87 Mon Sep 17 00:00:00 2001 From: "yangyufans@126.com" <> Date: Sat, 30 Aug 2025 14:28:47 +0800 Subject: [PATCH] nginx 1.29.1 --- nginx/1.29.1/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ nginx/1.29.1/start.sh | 8 ++++++++ 2 files changed, 45 insertions(+) create mode 100644 nginx/1.29.1/Dockerfile create mode 100644 nginx/1.29.1/start.sh diff --git a/nginx/1.29.1/Dockerfile b/nginx/1.29.1/Dockerfile new file mode 100644 index 0000000..5caa08f --- /dev/null +++ b/nginx/1.29.1/Dockerfile @@ -0,0 +1,37 @@ +FROM centos:8 + +MAINTAINER Yang + +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"] \ No newline at end of file diff --git a/nginx/1.29.1/start.sh b/nginx/1.29.1/start.sh new file mode 100644 index 0000000..64e50fe --- /dev/null +++ b/nginx/1.29.1/start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ ! -e /nginx/conf/nginx.conf ]; then + cp /usr/local/nginx/conf/nginx.conf /nginx/conf + sed -i "s/mime.types/\/usr\/local\/nginx\/conf\/mime.types/" /nginx/conf/nginx.conf +fi + +/usr/local/nginx/sbin/nginx -c /nginx/conf/nginx.conf -g 'daemon off;' \ No newline at end of file