diff --git a/.github/workflows/docker-build-push-monerod.yml b/.github/workflows/docker-build-push-monerod.yml index 31626b6..5a99a3a 100644 --- a/.github/workflows/docker-build-push-monerod.yml +++ b/.github/workflows/docker-build-push-monerod.yml @@ -38,7 +38,7 @@ jobs: uses: docker/build-push-action@v5 with: context: monerod - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker-compose.yml b/docker-compose.yml index 44f955d..dc8cd01 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,13 +12,17 @@ services: - monerod:/srv/monerod - /dev/null:/srv/monerod/bitmonero.log command: + - --non-interactive - --data-dir=/srv/monerod - --log-level=0 - --rpc-bind-ip=0.0.0.0 - --confirm-external-bind - --zmq-pub=tcp://0.0.0.0:18083 - --no-igd + - --add-priority-node=p2pmd.xmrvsbeast.com:18080 + - --add-priority-node=nodes.hashvault.pro:18080 - --disable-dns-checkpoints + - --enable-dns-blocklist - --config-file=/srv/monerod/bitmonero.conf p2pool: diff --git a/monerod/Dockerfile b/monerod/Dockerfile index b7d93ab..dfd5558 100644 --- a/monerod/Dockerfile +++ b/monerod/Dockerfile @@ -1,24 +1,41 @@ -# https://github.com/sethforprivacy/simple-monerod-docker -# https://hub.docker.com/r/sethsimmons/simple-monerod/tags -FROM sethsimmons/simple-monerod:v0.18.3.1 +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 \ + && apt-get -y upgrade \ + && apt-get -y install curl bzip2 \ + && apt-get -y clean \ + && rm -rf /var/lib/apt + +FROM base as builder +RUN set -eux \ + \ + && curl -Lo $TARBALL $DOWNLOAD/$TARBALL \ + && sha256sum $TARBALL \ + && echo "$HASH $TARBALL" > SHA256SUMS \ + && sha256sum -c SHA256SUMS \ + && tar xf $TARBALL \ + && rm $TARBALL \ + && mv /$NAME-* /$NAME + +FROM base +COPY --from=builder /$NAME/$NAME* /usr/bin/ ARG m_USER=monerod ARG m_UID=801 ARG m_GID=$m_UID -ARG m_HOME=/nonexistent -ARG m_SHELL=/usr/sbin/nologin -USER root -WORKDIR / RUN set -eux \ \ - && sed -i "s/fixuid -q//" /entrypoint.sh \ - && rm -f /usr/local/bin/fixuid \ - && chown 0:0 /usr/local/bin/monerod \ - && mv /usr/local/bin/monerod /usr/bin \ - && deluser --remove-home monero \ - && addgroup -S -g $m_GID $m_USER \ - && adduser -h $m_HOME -s $m_SHELL -G $m_USER -u $m_UID -D -g "" $m_USER \ + && addgroup --system --gid $m_GID $m_USER \ + && adduser --system --uid $m_UID --gid $m_GID --disabled-password $m_USER \ && mkdir -m 0700 /srv/monerod \ && chown $m_UID:$m_GID /srv/monerod @@ -26,10 +43,17 @@ VOLUME /srv/monerod USER $m_USER:$m_USER -CMD ["--data-dir", "/srv/monerod", \ - "--log-level", "0",\ - "--rpc-bind-ip", "0.0.0.0", "--confirm-external-bind", \ - "--zmq-pub", "tcp://0.0.0.0:18083", \ +HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://localhost:18081/get_info || exit 1 + +ENTRYPOINT ["monerod"] +CMD ["--non-interactive", \ + "--data-dir=/srv/monerod", \ + "--log-level=0", \ + "--rpc-bind-ip=0.0.0.0", "--confirm-external-bind", \ + "--zmq-pub=tcp://0.0.0.0:18083", \ "--no-igd", \ - "--out-peers", "16", "--in-peers", "8", \ - "--disable-dns-checkpoints"] + "--out-peers=8", "--in-peers=16", \ + "--add-priority-node=p2pmd.xmrvsbeast.com:18080", \ + "--add-priority-node=nodes.hashvault.pro:18080", \ + "--disable-dns-checkpoints", \ + "--enable-dns-blocklist"]