File tree 2 files changed +9
-3
lines changed
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
25
25
ARG NGINX_GROUP_GID=101
26
26
27
27
# https://nginx.org/en/docs/http/ngx_http_v3_module.html
28
+ # https://nginx.org/en/docs/configure.html
28
29
ARG CONFIG="\
29
30
--build=$NGINX_COMMIT \
30
31
--prefix=/etc/nginx \
@@ -176,11 +177,14 @@ RUN \
176
177
&& mv /usr/src/njs/build/njs /usr/sbin/njs \
177
178
&& echo "njs v$(njs -v)"
178
179
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'
179
183
RUN \
180
184
echo "Building nginx ..." \
181
185
&& mkdir -p /var/run/nginx/ \
182
186
&& cd /usr/src/nginx-$NGINX_VERSION \
183
- && ./auto/configure $CONFIG \
187
+ && ./auto/configure $CONFIG --with-cc-opt= "$CC_OPT" --with-ld-opt= "$LD_OPT" \
184
188
&& make -j"$(getconf _NPROCESSORS_ONLN)"
185
189
186
190
RUN \
@@ -213,8 +217,8 @@ ARG NGINX_COMMIT
213
217
ARG NGINX_USER_UID
214
218
ARG NGINX_GROUP_GID
215
219
216
- ENV NGINX_VERSION $NGINX_VERSION
217
- ENV NGINX_COMMIT $NGINX_COMMIT
220
+ ENV NGINX_VERSION= $NGINX_VERSION
221
+ ENV NGINX_COMMIT= $NGINX_COMMIT
218
222
219
223
COPY --from=base /var/run/nginx/ /var/run/nginx/
220
224
COPY --from=base /tmp/runDeps.txt /tmp/runDeps.txt
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ configure arguments:
82
82
--add-module=/usr/src/headers-more-nginx-module-0.37
83
83
--add-module=/usr/src/njs/nginx
84
84
--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'
85
87
86
88
$ docker run -it macbre/nginx-http3 njs -v
87
89
0.8.6
You can’t perform that action at this time.
0 commit comments