Skip to content

Commit a672a49

Browse files
authored
fix(cubestore): Configure OpenSSL static linking paths for builder (#10311)
Use multi-stage Docker builds with TARGETARCH to set platform-specific OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR environment variables. This allows static OpenSSL linking on both amd64 and arm64 architectures.
1 parent 75565cf commit a672a49

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

rust/cubestore/builder.Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG RUST_TAG=bookworm-slim
22
ARG OS_NAME=bookworm
33

4-
FROM rust:$RUST_TAG
4+
FROM rust:$RUST_TAG AS base
55

66
ARG OS_NAME=bookworm
77
ARG LLVM_VERSION=18
@@ -27,4 +27,15 @@ RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLV
2727
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$LLVM_VERSION 100 \
2828
&& update-alternatives --install /usr/bin/lld lld /usr/bin/lld-$LLVM_VERSION 100;
2929

30-
WORKDIR /usr/src
30+
# Platform-specific OpenSSL paths for static linking
31+
FROM base AS final-amd64
32+
ENV OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
33+
ENV OPENSSL_INCLUDE_DIR=/usr/include
34+
35+
FROM base AS final-arm64
36+
ENV OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu
37+
ENV OPENSSL_INCLUDE_DIR=/usr/include
38+
39+
# Select final stage based on target architecture
40+
ARG TARGETARCH=amd64
41+
FROM final-${TARGETARCH}

0 commit comments

Comments
 (0)