This PR introduces a number of configuration files which facilitate use of a Docker environment for local development and bitcoind execution. I’ve found this method to be an easy way to quickly setup a local dev environment; the use of a container also allows us to prevent polluting the host system with Bitcoin-specific dependencies.
The base image that I reference in the Dockerfile is maintained by Docker in an “official” image repository. It’s based on Debian 8 “Jessie” and comes with Python 3.6.2 for running the tests.
After obtaining the Docker dependencies (as described in docs/build-docker.md
), building and testing bitcoin from scratch can be done in a single command:
0docker-compose run bitcoind test
During the docker image build (docker-compose build bitcoind
), system dependencies are installed per docs/build-unix.md
(including all non-GUI optional dependencies) but Bitcoin itself isn’t compiled. This is because docker-compose
attaches the source tree to the container as a mounted volume after build, which allows changes we make to the source on the host machine to propagate immediately to a running container. The entrypoint script (./bin/docker_entrypoint.sh
) is responsible for handling bitcoind compilation as well as providing the test*
commands. Clang is installed and used as the default compiler.
You’ll notice that a few files (Dockerfile
, bin/
, docker-compose.yaml
) are introduced to the top-level of the directory structure. I wasn’t eager to do this – I started out in contrib/
, but in order for docker-compose
to mount the entire source tree, commands have to be executed from the project root.
This is a modest suggestion and I’m happy to help incorporate feedback.