Skip to content

Commit

Permalink
Add support to build arm images
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobaiao committed Feb 20, 2024
1 parent 0973d1a commit 22d8a8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
fi
fi
if [[ ${LITECOIN_VERSION} != *"alpine"* ]] && [ $(version ${LITECOIN_VERSION}) -ge $(version "0.21") ]; then
PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64"
fi
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=docker_platforms::${PLATFORMS}
echo ::set-output name=push::${PUSH}
Expand Down
9 changes: 7 additions & 2 deletions 0.21/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/dow
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu

ARG TARGETPLATFORM
ENV LITECOIN_VERSION=0.21.2.2
ENV LITECOIN_DATA=/home/litecoin/.litecoin

RUN curl -SLO https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/linux/litecoin-${LITECOIN_VERSION}-x86_64-linux-gnu.tar.gz \
RUN set -ex \
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
&& curl -SLO https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/linux/litecoin-${LITECOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
&& curl -SLO https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/SHA256SUMS.asc \
&& gpg --verify SHA256SUMS.asc \
&& grep $(sha256sum litecoin-${LITECOIN_VERSION}-x86_64-linux-gnu.tar.gz | awk '{ print $1 }') SHA256SUMS.asc \
&& grep $(sha256sum litecoin-${LITECOIN_VERSION}-${TARGETPLATFORM}.tar.gz | awk '{ print $1 }') SHA256SUMS.asc \
&& tar --strip=2 -xzf *.tar.gz -C /usr/local/bin \
&& rm *.tar.gz

Expand Down

0 comments on commit 22d8a8e

Please sign in to comment.