Make initial version of the README file; Closes #2

This commit is contained in:
Damian Mee 2019-02-07 20:38:13 +07:00
parent 1e2eece44e
commit a04ea5797d
No known key found for this signature in database
GPG Key ID: 2F961EAB8789725D

View File

@ -1,63 +1,61 @@
# Alpine Dockerfile
# docker-bitcoind
## About
[![Build Status](https://travis-ci.com/lncm/docker-bitcoind.svg?branch=0.17.1)](https://travis-ci.com/lncm/docker-berkeleydb) ![](https://img.shields.io/microbadger/image-size/lncm/berkeleydb/0.17.1.svg?style=flat) ![](https://img.shields.io/docker/pulls/lncm/berkeleydb.svg?style=flat)
This dockerfile is based on [ruimarinho/docker-bitcoin-core](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.17/alpine/Dockerfile) however its made to work for raspberry pi installs, and also has wallet disabled. This also builds on x86_64 environment too.
This Dockerfile is based on the excellent work from [ruimarinho/docker-bitcoin-core](https://github.com/ruimarinho/docker-bitcoin-core/).
I've also removed the entrypoint has that has some issues, and replaced it to work without.
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…
[image]: https://hub.docker.com/r/lncm/berkeleydb
> **NOTE:** ZMQ `block` and `tx` ports are set to `28332` and `28333` respectively.
## Need a bitcoin config file?
## Tags
Use one of my [scripts](https://gitlab.com/nolim1t/financial-independence/tree/master/contrib/lightningd-config-generator) or [scripts(1)](https://github.com/lncm/dockerfiles/tree/master/contrib/lightningd-config-generator) which generates a bitcoin.conf and matching lightning conf.
* `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
* `0.17.1-linux-amd64` - Bitcoin Core version 0.17.1 for `amd64` architecture
## Invocation
## Usage
First pull the image from [Docker Hub]:
```bash
# Install dependencies (Alpine)
apk add pwgen
apk add curl
apk add bash
apk add python3
# Go to lncm directory (Alpine)
cd /home/lncm
# Generate config
curl "https://gitlab.com/nolim1t/financial-independence/raw/master/contrib/lightningd-config-generator/generate-config.sh" 2>/dev/null | bash
mkdir .bitcoin
mv bitcoin.conf .bicoin
mkdir .lnd
mv lnd.conf .lnd
mkdir .lightning
mv lightningconfig .lightning/config
# Grab image (arm)
docker pull lncm/bitcoind:0.17.0-alpine-arm7
# Grab Image (x86_64 / 0.17.1)
docker pull lncm/bitcoind:0.17.1-alpine-x86_64
# Grab image (arm / 0.17.1)
docker pull lncm/bitcoind:0.17.1-alpine-arm
# Run image (map lncm/.bitcoin to bitcoin/.bitcoin)
docker run -it --rm \
-v $HOME/.bitcoin:/home/bitcoin/.bitcoin \
-p 0.0.0.0:8332:8332 \
-p 0.0.0.0:8333:8333 \
-p 0.0.0.0:28333:28333 \
-p 0.0.0.0:28332:28332 \
--name btcbox \
-d=true \
lncm/bitcoind:0.17.1-alpine-arm
docker pull lncm/bitcoind:0.17.1
```
## Supported platforms
> **NOTE:** Running above will automatically choose native architecture of your CPU.
Both x86 and arm are supported with this docker file.
[Docker Hub]: https://hub.docker.com/r/lncm/bitcoind
Then to run it, execute:
```bash
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,
* that command will run the container in the background and print the ID of the container being run.