Flexible multi-arch (amd & amd64) Bitcoin Core Docker image
1M+
This repo builds bitcoind in an auditable way, and packages it into a minimal Docker containers provided for various CPU architectures.
The work here was initially based on ruimarinho/docker-bitcoin-core, but has significantly diverged since.
git-tags (and most commits) are signed by D8CA1776EB9265491D07CE67F546ECBEA809CB18git-tags (and most commits) are opentimestamps-edgit tag push, the entire process is automated, with each step printed, and the code aiming to be easy to followqemumake check test suite, BerkeleyDB is build separately hereamd64, arm64v8, and arm32v7git-tags are build automatically, and with an auditable tracegit tag pushes result Docker image to Docker Hublnd version gets overridden, previous one is preserved)final images are based on Alpine for minimum base sizestrippedgit-tag build is tagged with a unique tag numberNOTE: ZMQ
blockandtxports are set to28332and28333respectively.
NOTE: For an always up-to-date list see: https://hub.docker.com/r/lncm/bitcoind/tags
v26.0v25.1v25.0v24.0.1v23.0v22.0v0.21.1v0.21.0v0.20.0v0.19.1v0.19.0.1v0.18.1v0.17.2v0.16.3v0.15.2First pull the image from Docker Hub:
docker pull lncm/bitcoind:v25.0
NOTE: Running above will automatically choose native architecture of your CPU.
Or, to pull a specific CPU architecture:
docker pull lncm/bitcoind:v25.0-arm64v8
First of all, create a directory in your home directory called .bitcoin
Next, create a config file. You can take a look at the following sample: thebox-compose-system (1).
Some guides on how to configure bitcoin can be found here (bitcoin git repo)
Then to start bitcoind, run:
docker run -it --rm --detach \
-v ~/.bitcoin:/data/.bitcoin \
-p 8332:8332 \
-p 8333:8333 \
-p 28332:28332 \
-p 28333:28333 \
--name bitcoind \
lncm/bitcoind:v25.0
That will run bitcoind such that:
~/.bitcoin on your host machine,8332 will be reachable for the RPC communication,8333 will be reachable for the peer-to-peer communication,28332 will be reachable for ZMQ block notifications,28333 will be reachable for ZMQ transaction notifications,bitcoind,bitcoind binary is run as unprivileged user bitcoind (UID=1000),To issue any commands to a running container, do:
docker exec -it bitcoind BINARY COMMAND
Where:
BINARY is either bitcoind, bitcoin-cli, bitcoin-tx, (or bitcoin-wallet on v0.18+) andCOMMAND is something you'd normally pass to the binaryExamples:
docker exec -it bitcoind bitcoind --help
docker exec -it bitcoind bitcoind --version
docker exec -it bitcoind bitcoin-cli --help
docker exec -it bitcoind bitcoin-cli -getinfo
docker exec -it bitcoind bitcoin-cli getblockcount
Here is a docker-compose.yml for mainnet
version: '3'
services:
bitcoin:
container_name: bitcoind
user: 1000:1000
image: lncm/bitcoind:v25.0
volumes:
- ./bitcoin:/data/.bitcoin
restart: on-failure
stop_grace_period: 15m30s
ports:
- "8333:8333"
- "8332:8332"
- "28332:28332"
- "28333:28333"
First, ensure that the bitcoin/ folder is in the directory containing docker-compose.yml.
Then, Docker Compose will mount the bitcoin/ folder to /data/.bitcoin.
Here are some possible reasons why.
The permissions for the bitcoin data direct is assumed to be UID 1000 (first user).
If you have a different setup, please do the following
# where ".bitcoin" is the data directory
sudo chown -R 1000.1000 $HOME/.bitcoin
Content type
Image
Digest
sha256:6b911de28…
Size
19.1 MB
Last updated
over 1 year ago
docker pull lncm/bitcoind:v27.2