From e64657c40091eabfe721bbc2d7757521903f1257 Mon Sep 17 00:00:00 2001 From: Zimovskii Anatolii Date: Mon, 5 Sep 2022 18:44:55 +0300 Subject: [PATCH] monerod --- .../debian/11-bullseye/main/Dockerfile | 14 +-- .../etc/apt/sources.list.d/github-cli.list | 1 - .../githubcli-archive-keyring.gpg | Bin 1795 -> 0 bytes linux/ecosystem/monero/monerod/Dockerfile | 49 ++++++++++ linux/ecosystem/monero/monerod/LICENSE | 21 +++++ linux/ecosystem/monero/monerod/Makefile | 19 ++++ linux/ecosystem/monero/monerod/README.md | 84 ++++++++++++++++++ .../monero/monerod/docker-compose.yml | 7 ++ linux/ecosystem/monero/monerod/entrypoint.sh | 16 ++++ .../monerod/examples/docker-compose.yml | 43 +++++++++ 10 files changed, 246 insertions(+), 8 deletions(-) delete mode 100644 linux/ecosystem/epicmorg/debian/11-bullseye/main/etc/apt/sources.list.d/github-cli.list delete mode 100644 linux/ecosystem/epicmorg/debian/11-bullseye/slim/etc/apt/trusted.gpg.d/githubcli-archive-keyring.gpg create mode 100644 linux/ecosystem/monero/monerod/Dockerfile create mode 100644 linux/ecosystem/monero/monerod/LICENSE create mode 100644 linux/ecosystem/monero/monerod/Makefile create mode 100644 linux/ecosystem/monero/monerod/README.md create mode 100644 linux/ecosystem/monero/monerod/docker-compose.yml create mode 100755 linux/ecosystem/monero/monerod/entrypoint.sh create mode 100644 linux/ecosystem/monero/monerod/examples/docker-compose.yml diff --git a/linux/ecosystem/epicmorg/debian/11-bullseye/main/Dockerfile b/linux/ecosystem/epicmorg/debian/11-bullseye/main/Dockerfile index f362365e8..a56530eeb 100644 --- a/linux/ecosystem/epicmorg/debian/11-bullseye/main/Dockerfile +++ b/linux/ecosystem/epicmorg/debian/11-bullseye/main/Dockerfile @@ -6,7 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive # perforce client binary ################################################################## ENV P4_VERSION=r22.1 -ENV P4_DOWNLOAD_URL=https://www.perforce.com/downloads/perforce/${P4_VERSION}/bin.linux26x86_64/p4 +ENV P4_DOWNLOAD_URL=https://filehost.perforce.com/perforce/${P4_VERSION}/bin.linux26x86_64/p4 ################################################################## # 7z official binary @@ -155,12 +155,12 @@ RUN apt-get update && \ ################################################################## # gh official binary ################################################################## -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C99B11DEB97541F0 -COPY etc/apt/sources.list.d/github-cli.list /etc/apt/sources.list.d/github-cli.list -RUN apt-get update && \ - apt-get install -y --allow-unauthenticated \ - gh && \ - gh --version +#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C99B11DEB97541F0 +#COPY etc/apt/sources.list.d/github-cli.list /etc/apt/sources.list.d/github-cli.list +#RUN apt-get update && \ +# apt-get install -y --allow-unauthenticated \ +# gh && \ +# gh --version ################################################################## # Install p4client diff --git a/linux/ecosystem/epicmorg/debian/11-bullseye/main/etc/apt/sources.list.d/github-cli.list b/linux/ecosystem/epicmorg/debian/11-bullseye/main/etc/apt/sources.list.d/github-cli.list deleted file mode 100644 index 4442663ff..000000000 --- a/linux/ecosystem/epicmorg/debian/11-bullseye/main/etc/apt/sources.list.d/github-cli.list +++ /dev/null @@ -1 +0,0 @@ -deb https://cli.github.com/packages stable main diff --git a/linux/ecosystem/epicmorg/debian/11-bullseye/slim/etc/apt/trusted.gpg.d/githubcli-archive-keyring.gpg b/linux/ecosystem/epicmorg/debian/11-bullseye/slim/etc/apt/trusted.gpg.d/githubcli-archive-keyring.gpg deleted file mode 100644 index ce02b812e5c2df973f8d4a7372cf4f7dac2d3d81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1795 zcmajeX*e4Q8VB$s1c`)(Zi=W-)2JiPwjv0LyN-&WI;!p?#I=G>Rf3|9I_7bWsH3z7 zqlOZ7rOv9fvQ?$D>Pk_=#936awmY-)?0(z#+xtBK|EKr;6$7(`Juma3fiS>F=0B+g z#hV3_n(<*^16_mv)cl#~TF&L2+JQsNKXAkjoTqbl8Ep_>IM|UGh6$dOe zs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j z;6Z=|av(rJ_SoKXV7RU|A4yw*^fkqeFk^0~mMs%V(>IcH%xal3#$-ZN-Mr0(Fd}!o z>o$T#^r3|GrG4;LNme3#!vjU zzhngXYGSS*jo0MWduji!Eh0B*!U;Bz2c;}6-*@?HtLmp4`({dxS#u{L{f$#bD(Kyo zYP*0sH_Di|%+$P*3v#+;_g?0HdA^@6nvDd-d*+XO2Go|g297Co9ILKimLaYcr1Tu) zqap~epiuf3s&}e*Yq?vBinIx>K~lnMRIfgHkgXJF-P?OK5|i95IHg2uJ*n%+&O1x@ Vq3;xM{p)VR8fciw*Mont`WIgEFnRz0 diff --git a/linux/ecosystem/monero/monerod/Dockerfile b/linux/ecosystem/monero/monerod/Dockerfile new file mode 100644 index 000000000..45e9c0f76 --- /dev/null +++ b/linux/ecosystem/monero/monerod/Dockerfile @@ -0,0 +1,49 @@ +FROM epicmorg/debian:bullseye +LABEL maintainer="original by sethforprivacy; EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +################################################################## +# ARGuments +################################################################## +ENV MONERO_DIR=/monero +ENV MONERO_BIN=${MONERO_DIR}/bin +ENV MONERO_DATA=${MONERO_DIR}/data +ENV MONERO_VERSION=0.18.1.0 +ENV MONERO_DOWNLOAD_URL=https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2 +ENV PATH="${PATH}:${MONERO_BIN}" + +################################################################## +# Installing +################################################################## +RUN mkdir /monero /monero/bin /monero/data + +RUN apt-get update && \ + apt-get install -y \ + libzmq3-dev + +RUN echo ${MONERO_BIN} +RUN wget -qO- ${MONERO_DOWNLOAD_URL} | tar -xvj --strip-components=1 -C ${MONERO_BIN} + +RUN export PATH="${PATH}:${MONERO_BIN}" + +RUN monerod --version + +# Expose p2p port +EXPOSE 18080 + +# Expose restricted RPC port +EXPOSE 18089 + +VOLUME ["${MONERO_DATA}"] +WORKDIR ${MONERO_DIR} + +# Add HEALTHCHECK against get_info endpoint +HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://localhost:18081/get_info || exit 1 + +# Copy and enable entrypoint script +COPY entrypoint.sh /entrypoint.sh +RUN set -ex && chmod +x /entrypoint.sh +ENTRYPOINT [ "/entrypoint.sh" ] + +# Start monerod with sane defaults that are overridden by user input (if applicable) +CMD ["--rpc-restricted-bind-ip=0.0.0.0", "--rpc-restricted-bind-port=18089", "--no-igd", "--no-zmq", "--enable-dns-blocklist"] diff --git a/linux/ecosystem/monero/monerod/LICENSE b/linux/ecosystem/monero/monerod/LICENSE new file mode 100644 index 000000000..1396ef396 --- /dev/null +++ b/linux/ecosystem/monero/monerod/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Seth Simmons (@sethsimmons) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/linux/ecosystem/monero/monerod/Makefile b/linux/ecosystem/monero/monerod/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/monero/monerod/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/monero/monerod/README.md b/linux/ecosystem/monero/monerod/README.md new file mode 100644 index 000000000..eccf84099 --- /dev/null +++ b/linux/ecosystem/monero/monerod/README.md @@ -0,0 +1,84 @@ +# Simple Monerod Docker + +A simple and straightforward Dockerized monerod built from source and exposing standard ports. + +## Actions + +[![Weekly Update Rebuild](https://github.com/sethforprivacy/simple-monerod-docker/actions/workflows/update-base-image.yml/badge.svg)](https://github.com/sethforprivacy/simple-monerod-docker/actions/workflows/update-base-image.yml) +[![Latest Dockerfile build on push](https://github.com/sethforprivacy/simple-monerod-docker/actions/workflows/update-image-on-push.yml/badge.svg)](https://github.com/sethforprivacy/simple-monerod-docker/actions/workflows/update-image-on-push.yml) + +## Docker + +![Docker Pulls](https://img.shields.io/docker/pulls/sethsimmons/simple-monerod) +![Docker Image Size (tag)](https://img.shields.io/docker/image-size/sethsimmons/simple-monerod/latest) +![Docker Image Version (latest by date)](https://img.shields.io/docker/v/sethsimmons/simple-monerod) + +## Docker Hub + +This repo is used to build the images available at: + +https://hub.docker.com/r/sethsimmons/simple-monerod + +## Tags + +I will always release the latest Monero version under the `latest` tag as well as the version number tag (i.e. `v0.18.0.0`). + +`latest`: The latest tagged version of Monero from https://github.com/monero-project/monero/tags, built on an Alpine base image +`vx.xx.x.x`: The version corresponding with the tagged version from https://github.com/monero-project/monero/tags, built on an Alpine base image + +Note that the primary focus and images are using the Alpine base image, but I will continue to support the Ubuntu based image for now. + +## Recommended usage + +I am using this container for my guide on running a Monero node: + +https://sethforprivacy.com/guides/run-a-monero-node/ + +The ways I would generally recommend running this container for a personal or public Monero node are below. + +monerod Docker w/o public RPC: + +```bash +sudo docker run -d --restart unless-stopped --name="monerod" -v bitmonero:/home/monero/.bitmonero sethsimmons/simple-monerod:latest --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --no-igd --no-zmq --enable-dns-blocklist +``` + +monerod Docker w/ public RPC: + +```bash +sudo docker run -d --restart unless-stopped --name="monerod" -v bitmonero:/home/monero/.bitmonero sethsimmons/simple-monerod:latest --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --public-node --no-igd --no-zmq --enable-dns-blocklist +``` + +monerod Docker w/o public RPC (pruned): + +```bash +sudo docker run -d --restart unless-stopped --name="monerod" -v bitmonero:/home/monero/.bitmonero sethsimmons/simple-monerod:latest --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --no-igd --no-zmq --enable-dns-blocklist --prune-blockchain +``` + +monerod Docker w/ public RPC (pruned): + +```bash +sudo docker run -d --restart unless-stopped --name="monerod" -v bitmonero:/home/monero/.bitmonero sethsimmons/simple-monerod:latest --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --public-node --no-igd --no-zmq --enable-dns-blocklist --prune-blockchain +``` + +## Running as a different user + +In situations where you need the daemon to be run as a different user, I have added [fixuid](https://github.com/boxboat/fixuid) to enable that. Much of the work for this was taken from [docker-monero](https://github.com/cornfeedhobo/docker-monero), and enables you to specify a new user/group in your `docker run` or `docker-compose.yml` file to run as a different user. + +- In `docker run` commands, you can specify the user like this: `--user 1000:1000` +- In `docker-compose.yml` files, you can specify the user like this: `user: ${FIXUID:-1000}:${FIXGID:-1000}` + +A great use-case for this is running with the daemon's files stored on an NFS mount, or running monerod on a Synology NAS. + +## Copyrights + +Code from this repository is released under MIT license. [Monero License](https://github.com/monero-project/monero/blob/master/LICENSE), [@leonardochaia License](https://github.com/leonardochaia/docker-monerod/blob/master/LICENSE) + +## Credits + +The base for the Dockerfile was pulled from: + +https://github.com/leonardochaia/docker-monerod + +The migration to Alpine from a Ubuntu 20.04 base image was based largely on previous commits from: + +https://github.com/cornfeedhobo/docker-monero diff --git a/linux/ecosystem/monero/monerod/docker-compose.yml b/linux/ecosystem/monero/monerod/docker-compose.yml new file mode 100644 index 000000000..ccd04aaf1 --- /dev/null +++ b/linux/ecosystem/monero/monerod/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.9' +services: + app: + image: "epicmorg/monero:latest" + build: + context: . + diff --git a/linux/ecosystem/monero/monerod/entrypoint.sh b/linux/ecosystem/monero/monerod/entrypoint.sh new file mode 100755 index 000000000..4d6479156 --- /dev/null +++ b/linux/ecosystem/monero/monerod/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Credit for the bulk of this entrypoint script goes to cornfeedhobo +# Source is https://github.com/cornfeedhobo/docker-monero/blob/master/entrypoint.sh +set -e + +# Set require --non-interactive flag +set -- "monerod" "--non-interactive" "$@" + +# Configure NUMA if present for improved performance +if command -v numactl >/dev/null 2>&1; then + numa="numactl --interleave=all" + set -- "$numa" "$@" +fi +# Start the daemon using fixuid +# to adjust permissions if needed +exec "$@" diff --git a/linux/ecosystem/monero/monerod/examples/docker-compose.yml b/linux/ecosystem/monero/monerod/examples/docker-compose.yml new file mode 100644 index 000000000..4e15824a5 --- /dev/null +++ b/linux/ecosystem/monero/monerod/examples/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3' + +services: + monerod: + image: sethsimmons/simple-monerod:latest + user: ${FIXUID:-1000}:${FIXGID:-1000} + restart: unless-stopped + container_name: monerod + volumes: + - bitmonero:/home/monero/.bitmonero + ports: + - 18080:18080 + - 18089:18089 + command: + - "--rpc-restricted-bind-ip=0.0.0.0" + - "--rpc-restricted-bind-port=18089" + - "--public-node" + - "--no-igd" + - "--enable-dns-blocklist" + - "--prune-blockchain" + + tor: + image: goldy/tor-hidden-service:latest + container_name: tor + restart: unless-stopped + links: + - monerod + environment: + MONEROD_TOR_SERVICE_HOSTS: 18089:monerod:18089 + MONEROD_TOR_SERVICE_VERSION: '3' + volumes: + - tor-keys:/var/lib/tor/hidden_service/ + + watchtower: + image: containrrr/watchtower:latest + container_name: watchtower + restart: unless-stopped + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + +volumes: + bitmonero: + tor-keys: