Skip to content

Commit cbf6d1c

Browse files
committed
CI: Use static musl coursier for x86_64
CI failed with "libz.so.1: cannot open shared object file" because x86_64 coursier binary (cs-x86_64-pc-linux.gz) is glibc-linked with relocation types (R_X86_64_GOTPCREL, R_X86_64_GOTOFF64) and symbols (__strtok_r, __strdup) that Alpine's gcompat cannot handle. - x86_64: Use cs-x86_64-pc-linux-static.gz (static musl binary, zero deps) - ARM64: Keep glibc installation (VirtusLab binary still requires it) - Simplify x86_64 path by removing glibc/gcompat/zlib dependencies - Move curl to coursier download RUN (needed by both architectures)
1 parent 065e0c3 commit cbf6d1c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,22 @@ ARG TARGETARCH
5454

5555
RUN mkdir /coursier_cache
5656

57-
# Install glibc and dependencies for coursier binaries (both amd64 and arm64 require glibc)
57+
# Install glibc for ARM64 coursier binary (x86-64 uses static musl build)
5858
RUN \
59-
apk add --no-cache curl wget gcompat libstdc++ zlib && \
60-
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
61-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk && \
62-
apk --no-cache --force-overwrite add glibc-2.35-r1.apk && \
63-
rm glibc-2.35-r1.apk && \
6459
if [ "$TARGETARCH" = "arm64" ]; then \
60+
apk add --no-cache wget gcompat libstdc++ && \
61+
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
62+
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk && \
63+
apk --no-cache --force-overwrite add glibc-2.35-r1.apk && \
64+
rm glibc-2.35-r1.apk && \
6565
ln -s /lib/ld-musl-aarch64.so.1 /lib/ld-linux-aarch64.so.1 2>/dev/null || true; \
6666
fi
6767

6868
RUN \
69+
apk add --no-cache curl && \
6970
case "$TARGETARCH" in \
7071
amd64|"") \
71-
CS_URL="https://github.com/coursier/coursier/releases/download/v${COURSIER_VERSION}/cs-x86_64-pc-linux.gz" ;; \
72+
CS_URL="https://github.com/coursier/coursier/releases/download/v${COURSIER_VERSION}/cs-x86_64-pc-linux-static.gz" ;; \
7273
arm64) \
7374
CS_URL="https://github.com/VirtusLab/coursier-m1/releases/download/v${COURSIER_VERSION}/cs-aarch64-pc-linux.gz" ;; \
7475
*) \

0 commit comments

Comments
 (0)