Fix Docker build missing websocket support

The Docker image first builds a static curl-impersonate, then builds
libcurl-impersonate separately. However, the second build overrode the
binary created in the first one, and was configured without websocket
support in addition. This commit fixes both:
* The second build does not override the first, static build.
* The second build is configured with websockets.
This commit is contained in:
lwthiker
2024-02-27 20:13:34 +02:00
parent 1f2bbd6565
commit d90993cf06
5 changed files with 25 additions and 10 deletions

View File

@@ -181,7 +181,8 @@ RUN mkdir out && \
RUN ./out/curl-impersonate -V | grep -q zlib && \
./out/curl-impersonate -V | grep -q brotli && \
./out/curl-impersonate -V | grep -q nghttp2 && \
./out/curl-impersonate -V | grep -q -e NSS -e BoringSSL
./out/curl-impersonate -V | grep -q -e NSS -e BoringSSL && \
./out/curl-impersonate -V | grep -q -e wss
# Verify that the resulting 'curl' is really statically compiled
RUN ! (ldd ./out/curl-impersonate | grep -q -e libcurl -e nghttp2 -e brotli -e ssl -e crypto)
@@ -191,6 +192,7 @@ RUN rm -Rf /build/install
# Re-compile libcurl dynamically
RUN cd ${CURL_VERSION} && \
./configure --prefix=/build/install \
--enable-websockets \
--with-nghttp2=/build/${NGHTTP2_VERSION}/installed \
--with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \
{{#firefox}}
@@ -262,7 +264,8 @@ RUN apt-get update && apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*
{{/debian}}
# Copy curl-impersonate from the builder image
COPY --from=builder /build/install /usr/local
COPY --from=builder /build/out/curl-impersonate* /usr/local/bin
COPY --from=builder /build/out/libcurl-impersonate* /usr/local/lib
{{#debian}}
# Update the loader's cache
RUN ldconfig