{"id":16561828,"url":"https://github.com/jamesob/docker-bitcoind","last_synced_at":"2025-03-16T20:30:41.393Z","repository":{"id":40775375,"uuid":"59036294","full_name":"jamesob/docker-bitcoind","owner":"jamesob","description":"A configurable docker image for bitcoind","archived":false,"fork":false,"pushed_at":"2023-05-09T18:12:53.000Z","size":58,"stargazers_count":87,"open_issues_count":2,"forks_count":58,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T12:46:19.024Z","etag":null,"topics":["bitcoin","bitcoind","docker"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesob.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-17T15:46:06.000Z","updated_at":"2024-07-09T09:44:41.000Z","dependencies_parsed_at":"2024-10-27T11:13:07.191Z","dependency_job_id":"26ff3400-a80c-4c2f-ae43-c3a8f56e109b","html_url":"https://github.com/jamesob/docker-bitcoind","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesob%2Fdocker-bitcoind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesob%2Fdocker-bitcoind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesob%2Fdocker-bitcoind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesob%2Fdocker-bitcoind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesob","download_url":"https://codeload.github.com/jamesob/docker-bitcoind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826798,"owners_count":20354221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bitcoind","docker"],"created_at":"2024-10-11T20:34:26.969Z","updated_at":"2025-03-16T20:30:41.064Z","avatar_url":"https://github.com/jamesob.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# docker-bitcoind\n\n[![Docker Stars](https://img.shields.io/docker/stars/jamesob/bitcoind.svg)](https://hub.docker.com/r/jamesob/bitcoind/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/jamesob/bitcoind.svg)](https://hub.docker.com/r/jamesob/bitcoind/)\n\nA Docker configuration with sane defaults for running a fully-validating\nBitcoin node. Binaries are retrieved from bitcoincore.org and verified for integrity\nbased on [the process described here](https://bitcoincore.org/en/download/).\n\nOptional building from arbitrary git objects is possible (and pretty convenient).\n\n## **Warning**: don't trust the Docker registry\n\nReferences on the Docker registry (https://hub.docker.com) are mutable. A malicious\nactor could change any images hosted there without you realizing it.\n\nIf you use an image served by the Docker registry, ensure that you retrieve\nit by its content hash, [as detailed here](https://stackoverflow.com/a/40730725).\nOr just build these images yourself.\n\nWith most software this doesn't matter too much, but running an authentic copy of\nBitcoin Core is really important!\n\n## **Warning**: don't trust Docker\n\nConsider whether your use of Bitcoin requires Docker. When you use a container runtime,\nyou are using a lot of additional code written by other people, e.g. `runc`, `docker`,\npotentially `docker-compose`, potentially `podman`.\n\nIs it necessary to rely on these dependencies? More code running underneath bitcoind\nis more chance for someone to meddle with the operation of your node.\n\n## **Warning**: don't rely on Dockerfile particulars\n\nThis repo may change Dockerfile implementation. Although the container interface itself\n(i.e. volume mounts, operational behavior) will remain stable, the implementation \nof how that happens is subject to change.\n\nIf your use relies on the particulars of, for example, the retrieval script\n(`get-bitcoin.sh`), please pin your usage of this repo to a particular git hash.\n\n\n## Tags available\n\n- 0.13.0\n- 0.13.1\n- 0.13.2\n- 0.14.3\n- 0.15.2\n- 0.16.3\n- 0.17.0\n- 0.17.0.1\n- 0.17.1\n- 0.17.2\n- 0.18.0\n- 0.18.1\n- 0.19.0\n- 0.19.1\n- 0.20.0\n- 0.20.1 \n- 0.21.0 \n- 0.21.1 \n- 0.21.2 \n- 22.0\n- 23.0\n\nAs well as various git refs.\n\n\n## Labels available\n\nEach image is built with certain labels:\n\n- `bitcoin_source`: \"release\" or \"git\", depending on how the binaries were built\n- `bitcoin_version`: if source=release, the release version (e.g. `23.0`), if\n  source=git \"git:\u003cgit ref\u003e\"\n- `git_ref`: if source=git, the tag or branch used to build the image\n- `git_sha`: if source=git, the specific git commit hash\n- `git_repo_url`: if source=git, the repo used to build\n\nLabels can be shown by running something like\n```sh\n% docker image inspect jamesob/bitcoind:master | jq '.[0] .Config .Labels'\n```\n```json\n{\n  \"bitcoin-configure-args\": \"--enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary --disable-ccache --disable-maintainer-mode --disable-dependency-tracking CFLAGS='-O2 -g'\",\n  \"bitcoin-source\": \"git\",\n  \"bitcoin-version\": \"git:master\",\n  \"git-ref\": \"master\",\n  \"git-repo-url\": \"https://github.com/bitcoin/bitcoin\",\n  \"git-sha\": \"551c8e9526d2502f857e1ef6348c7f1380f37443\"\n}\n```\n\n## Quick start\n\nRequires that [Docker be installed](https://docs.docker.com/install/) on the host machine.\n\n### Autogenerating a config\n\n```sh\n# Create some directory where your bitcoin data will be stored.\n$ mkdir /home/youruser/bitcoin_data\n\n$ $EDITOR envfile\nBTC_RPCPASSWORD=your_password\n\n$ docker run --name bitcoind -d \\\n   -e 'BTC_RPCUSER=foo' \\\n   -e 'BTC_TXINDEX=1' \\\n   --env-file envfile \\\n   -v /home/youruser/bitcoin_data:/bitcoin/data \\\n   -p 127.0.0.1:8332:8332 \\\n   -p 8333:8333 \\\n   jamesob/bitcoind:0.20.1\n\n$ docker logs -f bitcoind\n[ ... ]\n```\n\n**Warning**: if you specify your RPC password without using an envfile, it may\nbe captured in your shell history. Use an envfile if you are going to use\n`BTC_RPCPASSWORD`.\n\nIf you want the RPC port to be accessible to remote hosts, remove the `127.0.0.1` from\nthe `-p ...8332` line and set `BTC_RPCBIND=0.0.0.0`.\n\n### Using your own config/datadir\n\nIf you want to use a preexisting data directory and your own config file, run\n\n```sh\n$ docker run --name jamesob/bitcoind:0.20.1 -d \\\n   -v /home/youruser/bitcoin_data:/bitcoin/data \\\n   -v /home/youruser/bitcoin.conf:/bitcoin/bitcoin.conf \\\n   -p 127.0.0.1:8332:8332 \\\n   -p 8333:8333 \\\n   jamesob/bitcoind:0.20.1\n```\n\n### Building yourself\n\nBy default, the container runs under UID,GID=1000 to avoid executing as a privileged\nuser. If you want to rebuild the container with different settings, you can do so:\n\n```\n$ git clone https://github.com/jamesob/docker-bitcoind\n$ cd docker-bitcoind\n$ docker build -t $YOUR_USER/bitcoind:$SOME_VERSION \\\n   --build-arg UID=$(id -u) \\\n   --build-arg GID=$(id -g) \\\n   --build-arg VERSION=$SOME_VERSION \\\n   --build-arg SOURCE=release \\\n   .\n```\n\nTo build an arbitrary git object:\n\n```\n$ ./bin/build-docker-bitcoin master\n$ ./bin/build-docker-bitcoin v24.0rc2\n$ ./bin/build-docker-bitcoin \u003csome git object\u003e\n```\n\n## Possible volume mounts\n\n| Path | Description |\n| ---- | ------- |\n| `/bitcoin/data` | Bitcoin's data directory |\n| `/bitcoin/bitcoin.conf` | Bitcoin's configuration file |\n\n\n\n## Configuration\n\nA custom `bitcoin.conf` file can be placed at `/bitcoin.conf`.\nOtherwise, a default will be automatically generated based\non environment variables passed to the container:\n\n| name | default |\n| ---- | ------- |\n| BTC_RPCUSER | btc |\n| BTC_RPCPASSWORD | \u003crandomly generated\u003e |\n| BTC_RPCPORT | 8332 |\n| BTC_RPCBIND | 127.0.0.1 |\n| BTC_RPCALLOWIP | ::/0 |\n| BTC_RPCCLIENTTIMEOUT | 30 |\n| BTC_DISABLEWALLET | 1 |\n| BTC_TXINDEX | 0 |\n| BTC_TESTNET | 0 |\n| BTC_DBCACHE | 0 |\n| BTC_ZMQPUBHASHTX | tcp://0.0.0.0:28333 |\n| BTC_ZMQPUBHASHBLOCK | tcp://0.0.0.0:28333 |\n| BTC_ZMQPUBRAWTX | tcp://0.0.0.0:28333 |\n| BTC_ZMQPUBRAWBLOCK | tcp://0.0.0.0:28333 |\n\n\n## Daemonizing\n\nThe smart thing to do if you're daemonizing is to use Docker's [builtin restart\npolicies](https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy)\n(i.e. `docker run --restart unless-stopped ...`), but if you're insistent on using\nsystemd, you could do something like\n\n```bash\n$ cat /etc/systemd/system/bitcoind.service\n\n# bitcoind.service #######################################################################\n[Unit]\nDescription=Bitcoind\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nExecStartPre=-/usr/bin/docker kill bitcoind\nExecStartPre=-/usr/bin/docker rm bitcoind\nExecStartPre=/usr/bin/docker pull jamesob/bitcoind\nExecStart=/usr/bin/docker run \\\n    --name bitcoind \\\n    -p 8333:8333 \\\n    -p 127.0.0.1:8332:8332 \\\n    -v /data/bitcoind:/root/.bitcoin \\\n    jamesob/bitcoind\nExecStop=/usr/bin/docker stop bitcoind\n```\n\nto ensure that bitcoind continues to run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesob%2Fdocker-bitcoind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesob%2Fdocker-bitcoind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesob%2Fdocker-bitcoind/lists"}