anym001/docker-bitcoind

GitHub: anym001/docker-bitcoind

提供自动化构建、签名验证的 Bitcoin Core 官方 Docker 镜像,帮助用户安全便捷地部署比特币全节点。

Stars: 1 | Forks: 0

# Bitcoind Docker 镜像 [![测试](https://img.shields.io/github/actions/workflow/status/anym001/docker-bitcoind/ci.yml?label=Tests)](https://github.com/anym001/docker-bitcoind/actions/workflows/ci.yml) [![构建](https://img.shields.io/github/actions/workflow/status/anym001/docker-bitcoind/build-docker.yml?label=Build)](https://github.com/anym001/docker-bitcoind/actions/workflows/build-docker.yml) [![许可证:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/anym001/docker-bitcoind/blob/HEAD/LICENSE) [![发布](https://img.shields.io/github/v/release/anym001/docker-bitcoind?label=Release)](https://github.com/anym001/docker-bitcoind/releases) [![GHCR](https://img.shields.io/badge/GHCR-docker--bitcoind-2496ED?logo=docker&logoColor=white)](https://github.com/anym001/docker-bitcoind/pkgs/container/docker-bitcoind) [![Docker Hub](https://img.shields.io/badge/Docker%20Hub-docker--bitcoind-2496ED?logo=docker&logoColor=white)](https://hub.docker.com/r/anym001/docker-bitcoind) 本仓库提供用于 Bitcoin Core (bitcoind) 的自动化、已验证且已签名的 Docker 镜像。 镜像基于从 v28.0 开始的所有官方发布版本进行构建,并推送到 GitHub Container Registry (GHCR)。 所有二进制文件均使用官方的 SHA256SUMS 和签名的校验和进行验证。 工作流会自动检测 bitcoin/bitcoin 的新版本发布,并触发 Docker 构建。 `latest` 标签仅指向最新的官方发布版本。 ## 目录 - [使用方法](#usage) - [配置](#configuration) - [环境变量](#environment-variables) - [安全性](#security) - [自动化构建系统](#automated-build-system) - [贡献](#contributing) ## 使用方法 镜像发布到 **GHCR** 和 **Docker Hub** —— 您可以根据喜好自行选择: ``` docker pull ghcr.io/anym001/docker-bitcoind: docker pull anym001/docker-bitcoind: # Docker Hub ``` 最小化示例: ``` docker run -d \ --name bitcoind \ -v /your/data/dir:/home/bitcoin/.bitcoin \ -p 8333:8333 \ -p 8332:8332 \ ghcr.io/anym001/docker-bitcoind: ``` 包含权限映射和额外参数: ``` docker run -d \ --name bitcoind \ -e PUID=1000 \ -e PGID=1000 \ -e UMASK=002 \ -e BITCOIND_EXTRA_ARGS="-txindex=1 -listen=1" \ -v /your/data/dir:/home/bitcoin/.bitcoin \ -p 8333:8333 \ -p 8332:8332 \ ghcr.io/anym001/docker-bitcoind: ``` 标签: - `` — 例如 29.2, 30.0(每次发布均会构建) - `-stable` — 例如 29-stable, 30-stable - `latest` — 指向最新的官方发布版本 ## 配置 如果您需要自定义配置,请在您的挂载目录中放置一个 `bitcoin.conf` 文件: ``` /your/data/dir/bitcoin.conf ``` 在容器内部,它会变成: ``` /home/bitcoin/.bitcoin/bitcoin.conf ``` 示例: ``` server=1 daemon=0 # RPC listen=1 rpcallowip=0.0.0.0/0 rpcbind=0.0.0.0 # ZMQ zmqpubrawblock=tcp://0.0.0.0:28332 zmqpubrawtx=tcp://0.0.0.0:28333 ``` 如果不存在任何配置,Bitcoin Core 将使用默认设置运行。 ## 环境变量 | 变量名 | 描述 | | :------------------ | :------------------------------------------------------------ | | `PUID` | 容器用户 UID(映射到主机 UID)。可选。 | | `PGID` | 容器用户组 GID(映射到主机 GID)。可选。 | | `UMASK` | 容器内部的默认文件创建掩码。默认值:002 | | `DATA_PERM` | 应用于数据目录的权限模式。默认值:2770 | | `BITCOIND_EXTRA_ARGS` | 附加到 bitcoind 命令的额外参数。 | ## 安全性 此镜像在设计时充分考虑了安全性: - 以非 root 用户 `bitcoin` 运行 - 使用最小化的基础镜像 (`debian:stable-slim`) - 二进制文件使用官方的 Guix 构建器密钥进行了 GPG 验证 - 未安装任何不必要的软件包 - 使用 `PUID`、`PGID` 和 `UMASK` 确保对挂载卷的安全访问 ## 自动化构建系统 1. `release-check.yml` 工作流: - 检查所有官方的 Bitcoin Core 版本发布 - 确定您的仓库中缺少哪些发布版本 - 针对缺少的版本触发 `build-docker.yml` - 对于最新版本传递 `LATEST=true` 2. `build-docker.yml` 工作流: - 下载官方二进制文件并验证 SHA256 + PGP 签名 - 提取所需的二进制文件(`bitcoind`、`bitcoin-cli`) - 构建并推送 Docker 镜像到 GHCR - 为每个版本创建 GitHub Release ## 许可证 本仓库的内容(Dockerfile、脚本和工作流)均基于 [MIT 许可证](https://github.com/anym001/docker-bitcoind/blob/HEAD/LICENSE) 授权。 本项目仅将 Bitcoin Core 打包为 Docker 镜像;本仓库不会修改或重新分发上游的 源代码。 [Bitcoin Core](https://github.com/bitcoin/bitcoin) 是在其自身的 MIT 许可证下分发的,所有上游的版权和商标均归其 各自所有者所有。 使用 [Claude Code](https://claude.com/claude-code) 构建。
标签:Docker, Retryablehttp, 区块链, 安全防御评估, 容器化部署, 比特币, 自动化CI/CD, 请求拦截