Adding dockerization for braidpool#473
Conversation
There was a problem hiding this comment.
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,cpunetBitcoin node, miner, and simulator API. - Add
docker-composedefinitions underdocker/(and remove the old rootdocker-compose.yml). - Add CI workflow to build/push Docker images, plus
.dockerignoreto 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
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
| 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 |
| # Build command arguments | ||
| ARGS="-o ${STRATUM_URL} -O ${WORKER_USER}:${WORKER_PASS} -t ${MINER_THREADS} --debug" | ||
|
|
| if [ -n "${!file_var}" ] && [ -r "${!file_var}" ]; then | ||
| export "${var}"="$(cat "${!file_var}")" | ||
| fi |
| if [ -n "${file_path}" ] && [ -r "${file_path}" ]; then | ||
| cat "${file_path}" | ||
| else | ||
| echo "${!var_name}" | ||
| fi |
| RUN git clone \ | ||
| --branch cpunet \ | ||
| --depth 1 \ | ||
| https://github.com/braidpool/bitcoin.git \ | ||
| . |
| 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/* |
nkatha23
left a comment
There was a problem hiding this comment.
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).
…or cpuminer and wait condition for cpuminer container chore: removing typo
8a4f5ea to
dce399b
Compare

Reopening PR #423 with reduced scope .
docker-composeunder the docker directory for single point of running docker containers .helmcharts have already been pushed upon and if required can be used for spawning k8s cluster locally for testing braidpool-mesh braidpool-chart.Marking this currently as a draft .