Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to build arm images #36

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading