Skip to content

Commit

Permalink
Also build arm64 container images
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Nov 11, 2023
1 parent d522629 commit 15a5765
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-push-monerod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: monerod
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-push-p2pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: p2pool
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
34 changes: 21 additions & 13 deletions monerod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
FROM debian:12-slim as base

ENV NAME=monero
ENV VERSION=v0.18.3.1
ENV TARBALL=$NAME-linux-x64-$VERSION.tar.bz2
ENV DOWNLOAD=https://downloads.getmonero.org/cli
ENV HASH=23af572fdfe3459b9ab97e2e9aa7e3c11021c955d6064b801a27d7e8c21ae09d

RUN set -eux \
\
&& apt-get -y update \
Expand All @@ -15,18 +8,33 @@ RUN set -eux \
&& rm -rf /var/lib/apt

FROM base as builder
RUN set -eux \

ARG NAME=monero
ARG VERSION=v0.18.3.1
ARG DOWNLOAD=https://downloads.getmonero.org/cli

RUN set -eux; \
\
case $(uname -m) in \
x86_64) \
ARCH=linux-x64 \
HASH=23af572fdfe3459b9ab97e2e9aa7e3c11021c955d6064b801a27d7e8c21ae09d \
;; \
aarch64) \
ARCH=linux-armv7 \
HASH=2ea2c8898cbab88f49423f4f6c15f2a94046cb4bbe827493dd061edc0fd5f1ca \
;; \
*) exit 1 ;; \
esac; \
TARBALL=$NAME-$ARCH-$VERSION.tar.bz2; \
echo "$HASH $TARBALL" > SHA256SUMS \
&& curl -Lo $TARBALL $DOWNLOAD/$TARBALL \
&& sha256sum $TARBALL \
&& echo "$HASH $TARBALL" > SHA256SUMS \
&& sha256sum -c SHA256SUMS \
&& tar xf $TARBALL \
&& rm $TARBALL \
&& mv /$NAME-* /$NAME
&& mv /$NAME-*-$VERSION /build

FROM base
COPY --from=builder /$NAME/$NAME* /usr/bin/
COPY --from=builder /build/monero* /usr/bin/

ARG m_USER=monerod
ARG m_UID=801
Expand Down
39 changes: 24 additions & 15 deletions p2pool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
FROM debian:12-slim as base

ENV NAME=p2pool
ENV VERSION=v3.8
ENV PACKAGE=$NAME-$VERSION
ENV ARCH=linux-x64
ENV TARBALL=$PACKAGE-$ARCH.tar.gz
ENV DOWNLOAD=https://github.com/SChernykh/$NAME/releases/download
ENV HASH=019d62a4bb6d3cf22950e07ad9b49158e6fdadc006a7589edf077b338f0baf98

RUN set -eux \
\
&& apt-get -y update \
Expand All @@ -17,18 +8,36 @@ RUN set -eux \
&& rm -rf /var/lib/apt

FROM base as builder
RUN set -eux \

ARG NAME=p2pool
ARG VERSION=v3.8
ARG PACKAGE=$NAME-$VERSION
ARG DOWNLOAD=https://github.com/SChernykh/$NAME/releases/download

RUN set -eux; \
\
case $(uname -m) in \
x86_64) \
ARCH=linux-x64 \
HASH=019d62a4bb6d3cf22950e07ad9b49158e6fdadc006a7589edf077b338f0baf98 \
;; \
aarch64) \
ARCH=linux-aarch64 \
HASH=3b233ae9e08fc2d5cd6698a1706c5869c9efa36b6db5e2752b766e29bc599f07 \
;; \
*) exit 1 ;; \
esac; \
TARBALL=$PACKAGE-$ARCH.tar.gz; \
echo "$HASH $TARBALL" > SHA256SUMS \
&& curl -Lo $TARBALL $DOWNLOAD/$VERSION/$TARBALL \
&& sha256sum $TARBALL \
&& echo "$HASH $TARBALL" > SHA256SUMS \
&& sha256sum -c SHA256SUMS \
&& tar xf $TARBALL
&& tar xf $TARBALL \
&& mv /$PACKAGE-$ARCH /build

FROM base
COPY --from=builder /$PACKAGE-$ARCH/p2pool /usr/bin
COPY --from=builder /build/p2pool /usr/bin

ARG m_USER=$NAME
ARG m_USER=p2pool
ARG m_UID=802
ARG m_GID=$m_UID

Expand Down
30 changes: 15 additions & 15 deletions xmrig/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
FROM debian:12 as base

ENV NAME=xmrig
ENV VERSION=6.20.0
ENV PACKAGE=$NAME-$VERSION
ENV ARCH=linux-static-x64
ENV TARBALL=$PACKAGE-$ARCH.tar.gz
ENV DOWNLOAD=https://github.com/xmrig/$NAME/releases/download
ENV HASH=ff6e67d725ee64b4607dc6490a706dc9234c708cff814477de52d3beb781c6a1

FROM debian:12-slim as base
RUN set -eux \
\
&& apt-get -y update \
Expand All @@ -17,20 +8,29 @@ RUN set -eux \
&& rm -rf /var/lib/apt

FROM base as builder

ARG NAME=xmrig
ARG VERSION=6.20.0
ARG PACKAGE=$NAME-$VERSION
ARG ARCH=linux-static-x64
ARG TARBALL=$PACKAGE-$ARCH.tar.gz
ARG DOWNLOAD=https://github.com/xmrig/$NAME/releases/download
ARG HASH=ff6e67d725ee64b4607dc6490a706dc9234c708cff814477de52d3beb781c6a1

RUN set -eux \
\
&& curl -Lo $TARBALL $DOWNLOAD/v$VERSION/$TARBALL \
&& sha256sum $TARBALL \
&& echo "$HASH $TARBALL" > SHA256SUMS \
&& curl -Lo $TARBALL $DOWNLOAD/v$VERSION/$TARBALL \
&& sha256sum -c SHA256SUMS \
&& tar xf $TARBALL \
&& cd $NAME-$VERSION \
&& mv /$NAME-$VERSION /build \
&& cd /build \
&& sha256sum -c SHA256SUMS

FROM base
RUN mkdir -m0700 /etc/xmrig
COPY --from=builder /$NAME-$VERSION/xmrig /usr/bin
COPY --from=builder --chmod=600 /$NAME-$VERSION/config.json /etc/xmrig
COPY --from=builder /build/xmrig /usr/bin
COPY --from=builder --chmod=600 /build/config.json /etc/xmrig

VOLUME /srv
WORKDIR /srv/xmrig
Expand Down

0 comments on commit 15a5765

Please sign in to comment.