Skip to content

Commit

Permalink
modify the inference of platform specific binary
Browse files Browse the repository at this point in the history
  • Loading branch information
aeweda committed Nov 13, 2024
1 parent 137b617 commit 8594052
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docker/bridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
FROM --platform=$TARGETPLATFORM witnet/witnet-rust:latest
FROM witnet/witnet-rust:latest

ARG TARGETPLATFORM

# Use a conditional COPY command based on the target platform
COPY witnet-centralized-ethereum-bridge-x86_64-unknown-linux-gnu /
COPY witnet-centralized-ethereum-bridge-aarch64-unknown-linux-gnu /

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
cp witnet-centralized-ethereum-bridge-x86_64-unknown-linux-gnu /witnet-centralized-ethereum-bridge; \
mv /witnet-centralized-ethereum-bridge-x86_64-unknown-linux-gnu /witnet-centralized-ethereum-bridge; \
rm /witnet-centralized-ethereum-bridge-aarch64-unknown-linux-gnu; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
cp witnet-centralized-ethereum-bridge-aarch64-unknown-linux-gnu /witnet-centralized-ethereum-bridge; \
cp /witnet-centralized-ethereum-bridge-aarch64-unknown-linux-gnu /witnet-centralized-ethereum-bridge; \
rm /witnet-centralized-ethereum-bridge-x86_64-unknown-linux-gnu; \
else \
echo "Unsupported platform: $TARGETPLATFORM"; \
exit 1; \
Expand Down

0 comments on commit 8594052

Please sign in to comment.