Skip to content

Commit

Permalink
Merge pull request #46 from Shourya742/fix-template-provider-dockerfile
Browse files Browse the repository at this point in the history
Make template provider dockerfile arch agnostic
  • Loading branch information
GitGab19 authored Aug 23, 2024
2 parents 15302e6 + d367ab4 commit 0666109
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions template-provider.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 debian:stable-slim as build
FROM debian:stable-slim as build

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

# Download the selected binary release of Bitcoin Core
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
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz; \
elif [ "$ARCH" = "arm64" ]; then \
BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-aarch64-linux-gnu.tar.gz; \
else \
echo "Unsupported architecture"; exit 1; \
fi && \
wget $BITCOIN_URL -O /tmp/bitcoin.tar.gz

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

0 comments on commit 0666109

Please sign in to comment.