Flexible multi-arch (amd & amd64) Bitcoin node Docker image
Go to file
Damian Mee 1feef9f6ac
Simplify build (#31)
* 1st Attempt at self-contained Dockerfile

* Fix build

* bulk change

* fixes

* 0.17.1 -> 0.17.2

* Only build 0.17

* Only build 0.16

* build all

* (Hopefully) fix 0.16

* simplify test workflow

* Try building 0.18 w/o emoji patch

* REALLY FUCKING FIXED

* Moved something to somewhere... goodnight...

* minor workflows improvements

* simplify & consistency++ of qemu perf script

* simplify qemu reference;  better GH release

* qemu-perf & qemu consistency++

* reverts brainfart

* consistency changes

* Comment style

* Add v0.18.1 fix to make tests pass

* Move APP to be a workflow-level variable

* simplify GPG

* Update actions/github-script version

* merge annotations into a single step

* bettermore

* morebettermore

* Add helper script to create new releases

* Enable Docker experimental with less lines
2020-03-13 23:25:46 +08:00
.github/workflows Simplify build (#31) 2020-03-13 23:25:46 +08:00
0.16 Simplify build (#31) 2020-03-13 23:25:46 +08:00
0.17 Simplify build (#31) 2020-03-13 23:25:46 +08:00
0.18 Simplify build (#31) 2020-03-13 23:25:46 +08:00
0.19 Simplify build (#31) 2020-03-13 23:25:46 +08:00
scripts Simplify build (#31) 2020-03-13 23:25:46 +08:00
.gitignore init commit 2019-02-06 19:55:51 +07:00
LICENSE apache to MIT 2019-02-07 14:57:23 +07:00
README.md test whitespace added 2019-08-11 15:58:36 +07:00

docker-bitcoind

This Dockerfile is based on the excellent work from ruimarinho/docker-bitcoin-core.

The changes from upstream include:

  • removal of everything except the very minimal alpine images for the latest bitcoin version
  • separation of berkeleydb stage into a separate image
  • removal of the entrypoint
  • removal of an extra user
  • overall simplifications and following defaults
  • more…

NOTE: ZMQ block and tx ports are set to 28332 and 28333 respectively.

Tags

  • latest, 0.17, 0.17.1 - currently latest version of Bitcoin Core for both arm and amd64
  • 0.17.1-linux-arm - Bitcoin Core version 0.17.1 for arm architecture (built manually on an RBP)
  • 0.17.1-linux-amd64 - Bitcoin Core version 0.17.1 for amd64 architecture (built via CI)

Usage

Pull

First pull the image from Docker Hub:

docker pull lncm/bitcoind:0.17.1 

NOTE: Running above will automatically choose native architecture of your CPU.

Start

Then to start bitcoind, execute:

docker run -it --rm \
    -v ~/.bitcoin:/root/.bitcoin \
    -p 8332:8332 \
    -p 8333:8333 \
    -p 28332:28332 \
    -p 28333:28333 \
    --name bitcoind \
    --detach \
    lncm/bitcoind:0.17.1

That will run bitcoind such that:

  • all data generated by the container is stored in ~/.bitcoin on your host machine,
  • port 8332 will be reachable for the RPC communication,
  • port 8333 will be reachable for the peer-to-peer communication,
  • port 28332 will be reachable for ZMQ block notifications,
  • port 28333 will be reachable for ZMQ transaction notifications,
  • created container will get named bitcoind,
  • that command will run the container in the background and print the ID of the container being run.

Interact

To issue any commands to a running container, do:

docker exec -it bitcoind BINARY COMMAND

Where:

  • BINARY is either bitcoind or bitcoin-cli, and
  • COMMAND is something you'd normally pass to the binary

Examples:

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