@@ -120,7 +120,14 @@ RUN \
120
120
&& apk add --no-cache --virtual .geoip2-build-deps \
121
121
libmaxminddb-dev \
122
122
&& apk add --no-cache --virtual .njs-build-deps \
123
- readline-dev
123
+ libedit-dev \
124
+ libxml2-dev \
125
+ libxslt-dev \
126
+ openssl-dev \
127
+ pcre-dev \
128
+ readline-dev \
129
+ zlib-dev \
130
+ && git config --global init.defaultBranch master
124
131
125
132
WORKDIR /usr/src/
126
133
@@ -164,22 +171,29 @@ RUN \
164
171
echo "Downloading ngx_http_geoip2_module ..." \
165
172
&& git clone --depth 1 --branch ${GEOIP2_VERSION} https://github.com/leev/ngx_http_geoip2_module /usr/src/ngx_http_geoip2_module
166
173
174
+ RUN \
175
+ echo "Cloning and configuring quickjs ..." \
176
+ && cd /usr/src \
177
+ && git clone https://github.com/bellard/quickjs quickjs \
178
+ && cd quickjs \
179
+ && make libquickjs.a \
180
+ && echo "quickjs $(cat VERSION)"
181
+
167
182
RUN \
168
183
echo "Cloning and configuring njs ..." \
169
- && mkdir /usr/src/njs \
170
- && cd /usr/src/njs \
184
+ && mkdir /usr/src/njs && cd /usr/src/njs \
171
185
&& git init \
172
186
&& git remote add origin https://github.com/nginx/njs.git \
173
187
&& git fetch --depth 1 origin ${NJS_COMMIT} \
174
188
&& git checkout -q FETCH_HEAD \
175
- && ./configure \
189
+ && ./configure --cc-opt= '-I /usr/src/quickjs' --ld-opt= "-L /usr/src/quickjs" \
176
190
&& make njs \
177
191
&& mv /usr/src/njs/build/njs /usr/sbin/njs \
178
192
&& echo "njs v$(njs -v)"
179
193
180
194
# 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'
195
+ ARG CC_OPT='-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -I /usr/src/quickjs '
196
+ ARG LD_OPT='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -L /usr/src/quickjs '
183
197
RUN \
184
198
echo "Building nginx ..." \
185
199
&& mkdir -p /var/run/nginx/ \
0 commit comments