diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 861898f..4b51653 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,6 +31,7 @@ jobs: function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } DASH_CORE_VERSION=${{matrix.version}} LATEST_DASH_CORE_MAJOR_VERSION=$(ls | grep 0 | sort -n | tail -n 1) + PLATFORMS="linux/amd64" PUSH=false REPO=uphold/dash-core TAGS=() @@ -61,7 +62,13 @@ jobs: PUSH=true fi fi + + if [[ ${DASH_CORE_VERSION} != *"alpine"* ]] && [ $(version ${DASH_CORE_VERSION}) -ge $(version "20") ]; 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} echo ::set-output name=tags::${TAGS[@]} echo "build=true" >> $GITHUB_ENV @@ -77,16 +84,17 @@ jobs: run: | TAGS=(${{ steps.prepare.outputs.tags }}) echo "Build date: ${{ steps.prepare.outputs.build_date }}" + echo "Docker platform: ${{ steps.prepare.outputs.docker_platforms }}" echo "Push: ${{ steps.prepare.outputs.push }}" echo "Tags: ${{ steps.prepare.outputs.tags }}" - echo docker buildx build \ + echo docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ --output "type=image,push=${{steps.prepare.outputs.push}}" \ --progress=plain \ --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ --build-arg "VCS_REF=${GITHUB_SHA::8}" \ $(printf "%s" "${TAGS[@]/#/ --tag }" ) \ ${{ matrix.version }}/ - docker buildx build \ + docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ --output "type=image,push=${{steps.prepare.outputs.push}}" \ --progress=plain \ --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ diff --git a/20/Dockerfile b/20/Dockerfile index 58048bf..aa59366 100644 --- a/20/Dockerfile +++ b/20/Dockerfile @@ -32,11 +32,15 @@ ENV DASH_VERSION=20.0.4 ENV DASH_FOLDER_VERSION=20.0.4 ENV DASH_DATA=/home/dash/.dashcore \ PATH=/opt/dashcore-${DASH_FOLDER_VERSION}/bin:$PATH -RUN curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/SHA256SUMS.asc \ - && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz \ - && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz.asc \ - && gpg --verify dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz.asc \ - && tar -xzf dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz -C /opt \ +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://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/SHA256SUMS.asc \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && gpg --verify dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && tar -xzf dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz -C /opt \ && rm *.tar.gz VOLUME ["/home/dash/.dashcore"]