mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2026-10-11 11:56:33 +00:00
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:
@@ -92,7 +92,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)
|
||||
@@ -102,6 +103,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 \
|
||||
--with-nss=/build/${NSS_VERSION}/dist/Release \
|
||||
@@ -137,6 +139,7 @@ FROM alpine:3.18
|
||||
# which is supplied by 'nss' on alpine.
|
||||
RUN apk add --no-cache nss
|
||||
# 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
|
||||
# Wrapper scripts
|
||||
COPY --from=builder /build/out/curl_* /usr/local/bin/
|
||||
|
||||
Reference in New Issue
Block a user