Skip to content

Instantly share code, notes, and snippets.

@martinadamsdev
Last active July 11, 2024 07:16
Show Gist options
  • Save martinadamsdev/a59d637cd3c05a25a32bdc6899d8dc4e to your computer and use it in GitHub Desktop.
Save martinadamsdev/a59d637cd3c05a25a32bdc6899d8dc4e to your computer and use it in GitHub Desktop.
build nginx image
FROM alpine as base
ARG NGINX_VERSION=1.27.0
RUN apk update && apk upgrade && \
apk add --no-cache --virtual .build-deps bash tar wget gcc g++ make file perl linux-headers ca-certificates openssl-dev pcre-dev zlib-dev openssl pcre zlib && \
where pcre && \
where openssl && \
where zlib
# wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && tar zxf nginx-${NGINX_VERSION}.tar.gz
# cd /nginx-${NGINX_VERSION} && \
# ./configure --prefix=/app/nginx \
# --with-cc-opt='-static -static-libgcc' \
# --with-ld-opt='-static' \
# --sbin-path=/sbin/nginx \
# --pid-path=/run/nginx.pid \
# --lock-path=/var/lock/nginx.lock \
# --conf-path=/etc/nginx/nginx.conf \
# --error-log-path=/dev/stderr \
# --http-log-path=/dev/stdout \
# --with-compat \
# --with-threads \
# --with-file-aio \
# --with-openssl=/usr/local/ssl \
# --with-zlib=/zlib-${ZLIB_VERSION} \
# --with-pcre=/pcre-${PCRE_VERSION} \
# --with-pcre \
# --with-pcre-jit \
# --with-http_ssl_module \
# --with-http_v2_module \
# --with-http_gunzip_module \
# --with-http_gzip_static_module \
# --with-http_slice_module \
# --with-http_stub_status_module \
# --with-http_realip_module \
# --with-http_auth_request_module \
# --with-http_addition_module \
# --with-http_sub_module \
# --with-stream && \
# make && make install
# FROM alpine
# COPY --from=base /app/nginx /app/nginx
# COPY --from=base /sbin/nginx /sbin/nginx
# COPY --from=base /etc/nginx /etc/nginx
# EXPOSE 80
# ENTRYPOINT ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment