Adding dockerization for braidpool by Sansh2356 · Pull Request #473 · braidpool/braidpool · GitHub
Skip to content

Adding dockerization for braidpool#473

Open
Sansh2356 wants to merge 2 commits into
devfrom
adding-docker-setup
Open

Adding dockerization for braidpool#473
Sansh2356 wants to merge 2 commits into
devfrom
adding-docker-setup

Conversation

@Sansh2356

Copy link
Copy Markdown
Contributor

Reopening PR #423 with reduced scope .

  • Including miner,braidpool-node and cpunet compatible bitcoin-node Dockerfile .
  • docker-compose under the docker directory for single point of running docker containers .
  • Including layer-caching to reduce the rebuilding of image from base by using dummy file compilation etc .
  • helm charts have already been pushed upon and if required can be used for spawning k8s cluster locally for testing braidpool-mesh braidpool-chart.
  • This does not adds on or improves upon the existing dockerfiles for dashboard which should be requiring the update when the structure settles down .

Marking this currently as a draft .

Copilot AI review requested due to automatic review settings June 4, 2026 04:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Docker-based workflow for running Braidpool components (cpunet Bitcoin node, braidpool node, miner) via docker-compose, plus Dockerfiles for dashboard-related services and a GitHub Actions workflow to publish Docker images. It also removes unused Rust dependencies related to bitcoincore RPC/ZMQ.

Changes:

  • Add Dockerfiles + entrypoints for braidpool-node, cpunet Bitcoin node, miner, and simulator API.
  • Add docker-compose definitions under docker/ (and remove the old root docker-compose.yml).
  • Add CI workflow to build/push Docker images, plus .dockerignore to shrink build contexts.

Reviewed changes

Copilot reviewed 16 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
node/Cargo.toml Removes bitcoincore RPC/ZMQ deps from node crate deps list.
Cargo.toml Removes bitcoincore RPC/ZMQ deps from workspace deps.
Cargo.lock Lockfile updates reflecting removed crates and dependency resolution changes.
docker/node/Dockerfile Multi-stage build for braidpool node + CLI with layer caching.
docker/node/docker-entrypoint.sh Entrypoint building CLI args from env + docker secrets.
docker/miner/Dockerfile Builds a pinned-commit external miner and packages runtime image.
docker/miner/docker-entrypoint.sh Runs miner in a retry loop.
docker/cpunet_bitcoin_node/Dockerfile Builds braidpool/bitcoin cpunet fork and packages runtime image.
docker/cpunet_bitcoin_node/docker-entrypoint.sh Writes bitcoin.conf from secrets and starts node.
docker/docker-compose.yml Compose for bitcoin + braidpool node + miner.
docker/docker-compose-dashboard.yml Compose for dashboard + simulator + dashboard API.
docker/dashboard/Dockerfile Dashboard build + nginx serving image.
docker/dashboard/api/Dockerfile Dashboard API Node image.
docker/simulator_api/Dockerfile Python image for simulator websocket API.
docker/secrets/.gitignore Ensures secrets aren’t committed (keeps *.example).
docker/secrets/bitcoin_rpc_user.txt.example Example RPC username.
docker/secrets/bitcoin_rpc_password.txt.example Example RPC password placeholder.
.github/workflows/docker-publish.yml CI workflow to build/push node/miner/cpunet images.
.dockerignore Reduces Docker build context for repo-root builds.
docker-compose.yml Removes old root compose file (dashboard compose moved under docker/).
Comments suppressed due to low confidence (1)

.dockerignore:50

  • The comment says docker compose files are ignored, but the only ignored path here is docker/README.md. Either update the comment or add the intended ignore patterns.
# Ignore docker compose files but keep entrypoint scripts
docker/README.md

Comment on lines +1 to +21
services:
web:
build:
context: ../dashboard
dockerfile: ../docker/dashboard/Dockerfile
ports:
- 80:80
simulator:
build:
context: ../tests
dockerfile: ../docker/simulator_api/Dockerfile
ports:
- 65433:65433
api:
build:
context: ../dashboard/api
dockerfile: ../docker/dashboard/api/Dockerfile
env_file:
- ../dashboard/api/.env
ports:
- 5000:5000 No newline at end of file
Comment on lines +6 to +8
# Build command arguments
ARGS="-o ${STRATUM_URL} -O ${WORKER_USER}:${WORKER_PASS} -t ${MINER_THREADS} --debug"

Comment on lines +9 to +11
if [ -n "${!file_var}" ] && [ -r "${!file_var}" ]; then
export "${var}"="$(cat "${!file_var}")"
fi
Comment on lines +10 to +14
if [ -n "${file_path}" ] && [ -r "${file_path}" ]; then
cat "${file_path}"
else
echo "${!var_name}"
fi
Comment on lines +19 to +23
RUN git clone \
--branch cpunet \
--depth 1 \
https://github.com/braidpool/bitcoin.git \
.
Comment on lines +38 to +48
RUN apt-get update && apt-get install -y --no-install-recommends \
libevent-2.1-7 \
libevent-core-2.1-7 \
libevent-extra-2.1-7 \
libevent-pthreads-2.1-7 \
libboost-filesystem1.81.0 \
libboost-thread1.81.0 \
libcapnp-0.9.2 \
libsqlite3-0 \
curl \
&& rm -rf /var/lib/apt/lists/*
Comment thread docker/docker-compose.yml
Comment on lines +61 to +66

@nkatha23 nkatha23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally . The full stack came up, Bitcoin CPUNet node synced to height ~24500, Braidpool node connected via IPC, and the CPUNet miner received jobs over Stratum. The three-container setup with shared IPC socket volume works well.

One issue I hit: the braidpool-node health check (curl http://localhost:6682/health) always fails because the RPC server binds to 127.0.0.1:6682 by default, so the check can't reach it. The node is actually running fine, it's just the health check that reports unhealthy, which then blocks the miner from starting. Fix is to pass --rpc-bind 0.0.0.0:6682 to the node, either via a command override in docker-compose.yml or by adding BRAIDPOOL_RPC_BIND handling to docker-entrypoint.sh.

:) Also noting Copilot's flag about the runtime image pinning libboost-filesystem1.81.0 and libboost-thread1.81.0 those version-suffixed package names are Debian bookworm specific and could break if the base image changes. Non-versioned names would be safer.

Apart from those two things the setup is solid and a big improvement over building Bitcoin from source manually (which hits Cap'n Proto version mismatches on Fedora).

@Sansh2356 Sansh2356 force-pushed the adding-docker-setup branch from 8a4f5ea to dce399b Compare June 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants