Skip to content

Commit

Permalink
Add more docker platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Jun 10, 2023
1 parent 3e289fb commit 188c5c0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
45 changes: 30 additions & 15 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
name: Docker Image CI
name: Build on master push

on: workflow_dispatch
on:
push:
branches:
- master

jobs:
env:
DOCKER_CLI_EXPERIMENTAL: enabled

jobs:
build:

name: Build Docker image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Checkout project
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
id: qemu

- name: build the Docker image
run: docker build -t groestlcoin/groestlcoind:latest .
- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
id: buildx

- name: docker push
run: docker push groestlcoin/groestlcoind:latest
- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/arm64,linux/amd64,linux/arm/v7 \
--tag groestlcoin/groestlcoind:latest \
--output "type=registry" .
24 changes: 9 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,8 @@
# Alpine would be nice, but it's linked again musl and breaks the groestlcoin core download binary
#FROM alpine:latest

FROM ubuntu:latest AS builder
ARG TARGETARCH

FROM builder AS builder_amd64
ENV ARCH=x86_64
FROM builder AS builder_arm64
ENV ARCH=aarch64
FROM builder AS builder_riscv64
ENV ARCH=riscv64

FROM builder_${TARGETARCH} AS build
FROM ubuntu:latest as builder
ARG TARGETPLATFORM

# Testing: gosu
#RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \
Expand All @@ -34,13 +25,16 @@ ARG GROESTLCOIN_CORE_SIGNATURE=287AE4CA1187C68C08B49CB2D11BD4F33F1DB499
# 3. Verifying pkg signature from main website should inspire confidence and reduce chance of surprises.
# Instead fetch, verify, and extract to Docker image
RUN cd /tmp \
&& 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 \
&& gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys ${GROESTLCOIN_CORE_SIGNATURE} \
&& wget https://github.com/Groestlcoin/groestlcoin/releases/download/v${VERSION}/SHA256SUMS.asc \
https://github.com/Groestlcoin/groestlcoin/releases/download/v${VERSION}/SHA256SUMS \
https://github.com/Groestlcoin/groestlcoin/releases/download/v${VERSION}/groestlcoin-${VERSION}-${ARCH}-linux-gnu.tar.gz \
https://github.com/Groestlcoin/groestlcoin/releases/download/v${VERSION}/groestlcoin-${VERSION}-${TARGETPLATFORM}.tar.gz \
&& gpg --verify --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS 2>/dev/null | grep "^\[GNUPG:\] VALIDSIG.*${GROESTLCOIN_CORE_SIGNATURE}\$" \
&& sha256sum --ignore-missing --check SHA25SUM \
&& tar -xzvf groestlcoin-${VERSION}-${ARCH}-linux-gnu.tar.gz -C /opt \
&& sha256sum --ignore-missing --check SHA256SUMS \
&& tar -xzvf groestlcoin-${VERSION}-${TARGETPLATFORM}.tar.gz -C /opt \
&& ln -sv groestlcoin-${VERSION} /opt/groestlcoin \
&& rm -v /opt/groestlcoin/bin/groestlcoin-qt

Expand All @@ -58,7 +52,7 @@ ARG USER_ID=1000
RUN groupadd -g ${GROUP_ID} groestlcoin \
&& useradd -u ${USER_ID} -g groestlcoin -d /groestlcoin groestlcoin

COPY --from=build /opt/ /opt/
COPY --from=builder /opt/ /opt/

RUN apt update \
&& apt install -y --no-install-recommends gosu libatomic1 \
Expand Down

0 comments on commit 188c5c0

Please sign in to comment.