Skip to content

Commit ae08ce0

Browse files
committed
fix: make the path from which we copy the libs portable to more archs
1 parent 4fe0fb0 commit ae08ce0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

scx_rustland/Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ RUN cargo build --release -p scx_rustland
3232

3333
FROM gcr.io/distroless/cc
3434

35+
ARG TARGETPLATFORM
36+
37+
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
38+
echo "Setting $COPY_LIBS_DIR to aarch64-linux-gnu" && \
39+
export COPY_LIBS_DIR="aarch64-linux-gnu"; \
40+
else \
41+
echo "Setting default COPY_LIBS_DIR x86_64-linux-gnu" && \
42+
export COPY_LIBS_DIR="x86_64-linux-gnu"; \
43+
fi
44+
3545
COPY --from=builder /scx/target/release/scx_rustland /scx_rustland
36-
COPY --from=builder /usr/lib/aarch64-linux-gnu/libelf.so.1 /usr/lib/libelf.so.1
37-
COPY --from=builder /usr/lib/aarch64-linux-gnu/libz.so.1 /usr/lib/libz.so.1
38-
COPY --from=builder /usr/lib/aarch64-linux-gnu/libseccomp.so.2 /usr/lib/libseccomp.so.2
46+
COPY --from=builder /usr/lib/$COPY_LIBS_DIR/libelf.so.1 /usr/lib/libelf.so.1
47+
COPY --from=builder /usr/lib/$COPY_LIBS_DIR/libz.so.1 /usr/lib/libz.so.1
48+
COPY --from=builder /usr/lib/$COPY_LIBS_DIR/libseccomp.so.2 /usr/lib/libseccomp.so.2
3949

4050
CMD ["/scx_rustland"]

0 commit comments

Comments
 (0)