Compare commits

..

2 Commits

Author SHA1 Message Date
2f96ac363c added Gitea action to build nginx image
Some checks failed
CI / Build nginx docker images (push) Failing after 1m33s
2024-09-17 11:39:30 +08:00
61adbf1e27 added nginx docker image 2024-09-17 11:39:25 +08:00

View File

@@ -1,6 +1,6 @@
FROM alpine:latest
ARG VERSION
ENV NGINX_VERSION=${VERSION}
FROM alpine:latest
RUN GPG_KEYS=D6786CE303D9A9022998DC6CC8464D549AF75C0A \
&& CONFIG="\
--prefix=/etc/nginx \
@@ -85,8 +85,8 @@ RUN GPG_KEYS=D6786CE303D9A9022998DC6CC8464D549AF75C0A \
zlib \
zlib-dev \
mercurial \
&& curl -fSL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -o nginx-${NGINX_VERSION}.tar.gz \
&& curl -fSL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz.asc -o nginx-${NGINX_VERSION}.tar.gz.asc \
&& curl -fSL https://nginx.org/download/nginx-${VERSION}.tar.gz -o nginx-${VERSION}.tar.gz \
&& curl -fSL https://nginx.org/download/nginx-${VERSION}.tar.gz.asc -o nginx-${VERSION}.tar.gz.asc \
&& export GNUPGHOME="$(mktemp -d)" \
&& found=''; \
for server in \
@@ -99,11 +99,11 @@ RUN GPG_KEYS=D6786CE303D9A9022998DC6CC8464D549AF75C0A \
gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
gpg --batch --verify nginx-${NGINX_VERSION}.tar.gz.asc nginx-${NGINX_VERSION}.tar.gz \
gpg --batch --verify nginx-${VERSION}.tar.gz.asc nginx-${VERSION}.tar.gz \
&& mkdir -p /usr/src \
&& tar -zxC /usr/src -f nginx-${NGINX_VERSION}.tar.gz \
&& rm nginx-${NGINX_VERSION}.tar.gz \
&& rm -rf "$GNUPGHOME" nginx-${NGINX_VERSION}.tar.gz.asc \
&& tar -zxC /usr/src -f nginx-${VERSION}.tar.gz \
&& rm nginx-${VERSION}.tar.gz \
&& rm -rf "$GNUPGHOME" nginx-${VERSION}.tar.gz.asc \
&& git clone --depth=1 --recurse-submodules https://github.com/google/ngx_brotli /usr/src/ngx_brotli \
&& git clone --depth=1 https://github.com/openresty/headers-more-nginx-module /usr/src/ngx_headers_more \
&& hg clone http://hg.nginx.org/njs /usr/src/njs \
@@ -115,7 +115,7 @@ RUN GPG_KEYS=D6786CE303D9A9022998DC6CC8464D549AF75C0A \
&& cmake -B/usr/src/boringssl/build -S/usr/src/boringssl -DCMAKE_BUILD_TYPE=RelWithDebInfo \
&& make -C/usr/src/boringssl/build -j$(getconf _NPROCESSORS_ONLN) \
) \
&& cd /usr/src/nginx-${NGINX_VERSION} \
&& cd /usr/src/nginx-${VERSION} \
&& curl -fSL https://raw.githubusercontent.com/nginx-modules/ngx_http_tls_dyn_size/master/nginx__dynamic_tls_records_1.25.1%2B.patch -o dynamic_tls_records.patch \
&& patch -p1 < dynamic_tls_records.patch \
&& ./configure $CONFIG --with-debug --with-cc-opt="-I/usr/src/boringssl/include" --with-ld-opt="-L/usr/src/boringssl/build/ssl -L/usr/src/boringssl/build/crypto" \
@@ -143,7 +143,7 @@ RUN GPG_KEYS=D6786CE303D9A9022998DC6CC8464D549AF75C0A \
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
&& strip /usr/sbin/nginx* \
&& strip /usr/lib/nginx/modules/*.so \
&& rm -rf /usr/src/nginx-${NGINX_VERSION} \
&& rm -rf /usr/src/nginx-${VERSION} \
&& rm -rf /usr/src/boringssl /usr/src/ngx_* /usr/src/njs \
\
# Bring in gettext so we can get `envsubst`, then throw
@@ -177,7 +177,7 @@ RUN APK_ARCH="$(cat /etc/apk/arch)"
LABEL description="NGINX Docker built top of rolling release BoringSSL" \
maintainer="Denis Denisov <denji0k@gmail.com>" \
openssl="BoringSSL" \
nginx="nginx ${NGINX_VERSION}" \
nginx="nginx ${VERSION}" \
arch="$APK_ARCH"
EXPOSE 80 443 443/udp