Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
include:
- image: standard
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/riscv64
- image: riscv
platforms: linux/amd64
- image: android
Expand Down
36 changes: 22 additions & 14 deletions docker/Dockerfile.standard
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,32 @@ RUN apt-get install -y \
ccache \
gcc-9 g++-9 \
gcc-13 g++-13 \
crossbuild-essential-armhf \
&& rm -rf /var/lib/apt/lists/*
clang-18 llvm-18 lld-18

RUN ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /usr/lib/ld-linux-armhf.so.3
ENV LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:${LD_LIBRARY_PATH}
# Declare TARGETARCH once; Buildx populates this automatically
ARG TARGETARCH

RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
apt-get update && \
apt-get install -y crossbuild-essential-armhf && \
ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /usr/lib/ld-linux-armhf.so.3 && \
rm -rf /var/lib/apt/lists/*; \
else \
echo "Skipping crossbuild-essential-armhf for architecture: $TARGETARCH"; \
fi

RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 18 && \
rm llvm.sh
# ENV is not allowed to be conditional in Dockerfile.
ENV LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:${LD_LIBRARY_PATH}

ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ]; then \
wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64; \
RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 && \
chmod +x /usr/local/bin/bazel; \
elif [ "$TARGETARCH" = "arm64" ]; then \
wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64 && \
chmod +x /usr/local/bin/bazel; \
else \
wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64; \
fi && \
chmod +x /usr/local/bin/bazel
echo "Skipping Bazel installation for unsupported architecture: $TARGETARCH"; \
fi

RUN ln -sf /usr/bin/python3 /usr/bin/python

Expand Down
Loading