Skip to content

Commit 0666109

Browse files
authored
Merge pull request #46 from Shourya742/fix-template-provider-dockerfile
Make template provider dockerfile arch agnostic
2 parents 15302e6 + d367ab4 commit 0666109

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

template-provider.dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 debian:stable-slim as build
1+
FROM debian:stable-slim as build
22

33
# Install & update base system
44
RUN apt-get update && apt-get upgrade -y
@@ -13,8 +13,15 @@ ENV BITCOIN_DIR=/bitcoin
1313
# Create the directory where Bitcoin Core will be installed
1414
RUN mkdir -p $BITCOIN_DIR
1515

16-
# Download the selected binary release of Bitcoin Core
17-
RUN wget https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz -O /tmp/bitcoin.tar.gz
16+
RUN ARCH=$(dpkg --print-architecture) && \
17+
if [ "$ARCH" = "amd64" ]; then \
18+
BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz; \
19+
elif [ "$ARCH" = "arm64" ]; then \
20+
BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-aarch64-linux-gnu.tar.gz; \
21+
else \
22+
echo "Unsupported architecture"; exit 1; \
23+
fi && \
24+
wget $BITCOIN_URL -O /tmp/bitcoin.tar.gz
1825

1926
# Extract the downloaded tarball
2027
RUN tar -xzvf /tmp/bitcoin.tar.gz -C $BITCOIN_DIR --strip-components=1

0 commit comments

Comments
 (0)