An open API service indexing awesome lists of open source software.

https://github.com/lanjelin/p2pool-zero

A rootless, distroless, from-scratch Docker image for running p2pool.
https://github.com/lanjelin/p2pool-zero

Last synced: about 2 months ago
JSON representation

A rootless, distroless, from-scratch Docker image for running p2pool.

Awesome Lists containing this project

README

          

# p2pool-zero

A secure, zero-footprint Docker image for running [P2Pool](https://github.com/SChernykh/p2pool) โ€” fully rootless, distroless, and built entirely `FROM scratch` for maximum isolation and minimal attack surface.

Hosted image:
๐Ÿ“ฆ [`ghcr.io/lanjelin/p2pool-zero`](https://ghcr.io/lanjelin/p2pool-zero)

---

## ๐Ÿ” Security-First Design

This image is built with a focus on container hardening:

* **Built from scratch** โ€” no shell, no package manager, no OS files.
* **Fully static binary** โ€” verified P2Pool release from upstream.
* **Runs as non-root** โ€” `USER 1000:1000` by default.
* Explicitly mounted volumes required for persistence.
* Extremely compact โ€” minimal attack surface, fast startup.

---

## ๐Ÿงฑ What's Inside?

* โœ… [`p2pool`](https://github.com/SChernykh/p2pool) `v4.9`

* Official precompiled binary verified via GPG and SHA256
* No shell, no libc, no package manager
* โœ… System CA certificates (for HTTPS peer fetching)

---

## ๐Ÿš€ Usage

> ๐Ÿง‘ You can override the container user with `--user` if needed to match mounted volume ownership.

Create a local data folder:

```bash
mkdir -p p2pool-data
```

Run the container:

```bash
docker run --rm -it \
-v "$(pwd)/p2pool-data:/data" \
-p 3333:3333 \
-p 37889:37889 \
ghcr.io/lanjelin/p2pool-zero \
--host "192.168.0.55" \
--rpc-port "18089" \
--zmq-port "18083" \
--wallet "44...YOUR_MONERO_ADDRESS...abc" \
--stratum "0.0.0.0:3333" \
--p2p "0.0.0.0:37889" \
--data-dir "/data"
```

This setup:

* Uses your Monero node via `--host` and `--rpc-port`
* Opens standard stratum (3333) and p2p (37889) ports
* Stores peer cache and stats in `./p2pool-data`

> ๐Ÿ’ก Replace `--wallet` with your own Monero address or it will default to donating hash rate.

---

## ๐Ÿงฉ Docker Compose

You can also run it with Compose:

```yaml
services:
p2pool:
image: ghcr.io/lanjelin/p2pool-zero
user: "1000:1000"
tty: true
stdin_open: true
volumes:
- ./p2pool-data:/data
ports:
- "3333:3333"
- "37889:37889"
command: >
--host "192.168.0.55"
--rpc-port "18089"
--zmq-port "18083"
--wallet "44...YOUR_MONERO_ADDRESS...abc"
--stratum "0.0.0.0:3333"
--p2p "0.0.0.0:37889"
--data-dir "/data"
```

To launch:

```bash
docker-compose up
```

---

## ๐Ÿ“ Volumes

This image requires manual volume mounting โ€” there are no internal writable paths.

### Required:

* `/data` โ€” peer info, stratum cache, stats, etc.

Ensure the mounted `./p2pool-data` folder is writable by UID `1000`.

---

## ๐Ÿ› ๏ธ Build Info

This image is built in **2 stages**:

1. **Builder stage (Debian)**

* Downloads official P2Pool binary and signature
* Verifies PGP signature and SHA256 hash
* Extracts binary and CA certificates

2. **Final `scratch` stage**

* Copies only `/bin/p2pool` and CA bundle
* Declares `USER 1000:1000` and entrypoint

No shell, no package manager, no unused files.

---

## ๐Ÿงช Building the Image Locally

```bash
git clone https://github.com/Lanjelin/p2pool-zero.git
cd p2pool-zero
docker build -t p2pool-zero .
```

> ๐Ÿ” GPG key for `SChernykh` is fetched from `keyserver.ubuntu.com` and verified before extracting the release.

---

## ๐Ÿ“– How to Mine

Follow the official mining guide here:
๐Ÿ”— [How to mine on P2Pool](https://github.com/SChernykh/p2pool#how-to-mine-on-p2pool)

---

## ๐Ÿ“œ License

P2Pool is licensed under GPL-3.
This Docker image does not modify the binary and complies with upstream licensing.

---

## ๐Ÿ‘ค Maintainer

**Lanjelin**
Image hosted at [ghcr.io/lanjelin/p2pool-zero](https://ghcr.io/lanjelin/p2pool-zero)

---