Skip to content

Commit

Permalink
Don't base monerod image on sethforprivacy/simple-monerod-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Nov 10, 2023
1 parent c397023 commit 5f4fd3e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 21 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,linux/arm64
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
64 changes: 44 additions & 20 deletions monerod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
# 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

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"]

0 comments on commit 5f4fd3e

Please sign in to comment.