File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ ARG NGINX_USER_UID=100
2525ARG NGINX_GROUP_GID=101
2626
2727# https://nginx.org/en/docs/http/ngx_http_v3_module.html
28+ # https://nginx.org/en/docs/configure.html
2829ARG CONFIG="\
2930 --build=$NGINX_COMMIT \
3031 --prefix=/etc/nginx \
@@ -176,11 +177,14 @@ RUN \
176177 && mv /usr/src/njs/build/njs /usr/sbin/njs \
177178 && echo "njs v$(njs -v)"
178179
180+ # https://github.com/macbre/docker-nginx-http3/issues/152
181+ ARG CC_OPT='-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects'
182+ ARG LD_OPT='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto'
179183RUN \
180184 echo "Building nginx ..." \
181185 && mkdir -p /var/run/nginx/ \
182186 && cd /usr/src/nginx-$NGINX_VERSION \
183- && ./auto/configure $CONFIG \
187+ && ./auto/configure $CONFIG --with-cc-opt= "$CC_OPT" --with-ld-opt= "$LD_OPT" \
184188 && make -j"$(getconf _NPROCESSORS_ONLN)"
185189
186190RUN \
@@ -213,8 +217,8 @@ ARG NGINX_COMMIT
213217ARG NGINX_USER_UID
214218ARG NGINX_GROUP_GID
215219
216- ENV NGINX_VERSION $NGINX_VERSION
217- ENV NGINX_COMMIT $NGINX_COMMIT
220+ ENV NGINX_VERSION= $NGINX_VERSION
221+ ENV NGINX_COMMIT= $NGINX_COMMIT
218222
219223COPY --from=base /var/run/nginx/ /var/run/nginx/
220224COPY --from=base /tmp/runDeps.txt /tmp/runDeps.txt
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ configure arguments:
8282 --add-module=/usr/src/headers-more-nginx-module-0.37
8383 --add-module=/usr/src/njs/nginx
8484 --add-dynamic-module=/usr/src/ngx_http_geoip2_module
85+ --with-cc-opt='-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects'
86+ --with-ld-opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto'
8587
8688$ docker run -it macbre/nginx-http3 njs -v
87890.8.6
You can’t perform that action at this time.
0 commit comments