Skip to content

Commit 39e9aa6

Browse files
committed
Use $TARGETPLATFORM in Dockerfile instead of RUBY_PLATFORM
RUBY_PLATFORM corresponds to $BUILDPLATFORM, but we need $TARGETPLATFORM actually. This is because we use the cache from the ARM64 system to build the ARM64 image on X86_64.
1 parent df65ec5 commit 39e9aa6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Dockerfile.mri.erb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ COPY --from=larskanis/mingw64-ucrt:20.04 \
2525
RUN dpkg -i /debs/*.deb
2626

2727
<% elsif platform =~ /aarch64-mingw-ucrt/ %>
28-
RUN wget https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-ubuntu-20.04-<%= RUBY_PLATFORM[/^\w+/] %>.tar.xz && \
28+
29+
RUN if [ "$TARGETPLATFORM"="linux/amd64" ]; then \
30+
DOWNLOAD_PLATFORM="x86_64"; \
31+
elif [ "$TARGETPLATFORM"="linux/arm64" ]; then \
32+
DOWNLOAD_PLATFORM="aarch64"; \
33+
else \
34+
echo "Unsupported platform $TARGETPLATFORM"; \
35+
exit 1; \
36+
fi && \
37+
\
38+
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-ubuntu-20.04-$DOWNLOAD_PLATFORM.tar.xz && \
2939
tar xf llvm-mingw*.tar.xz && \
3040
mv `ls -d llvm-mingw-*/` /llvm-mingw && \
3141
echo "export PATH=/llvm-mingw/bin:\$PATH" >> /etc/rubybashrc && \

0 commit comments

Comments
 (0)