fix(docker): install CA certificates before the browserskill mirror swap (#4104)

node:24-bookworm-slim has no trust store. Switching apt to
mirrors.tencent.com first follows an HTTP to HTTPS redirect and the
package install fails. Install ca-certificates from the original HTTP
source before the swap, matching the runtime stage.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: fight for you <wangrui19971019@users.noreply.github.com>
main
fight for you 2026-10-10 11:59:00 +08:00 committed by GitHub
parent 6e2e5d8bb0
commit 097bd475f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -3,7 +3,13 @@ FROM --platform=$TARGETPLATFORM node:24-bookworm-slim@sha256:ba849c60be29959425b
WORKDIR /build
# Use the same optional Debian mirror as the Go builder and runtime stages.
ARG APK_MIRROR_ARG
# This base image has no CA certificates. Install them from the original HTTP
# Debian source before swapping in a mirror: mirrors.tencent.com redirects
# apt to HTTPS, and that handshake fails without a trust store.
RUN if [ -n "$APK_MIRROR_ARG" ]; then \
apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
sed -i "s@deb.debian.org@${APK_MIRROR_ARG}@g" /etc/apt/sources.list.d/debian.sources; \
fi && \
apt-get update && \