This containers are maintained by LNP/BP Standards Association
- Bitcoin Core: https://hub.docker.com/r/lnpbp/bitcoind
- c-Lightning: https://hub.docker.com/r/lnpbp/lightningd
- Electrs: https://hub.docker.com/r/lnpbp/electrs
- RGB Node: https://hub.docker.com/r/lnpbp/rgbd
- LNP Node: https://hub.docker.com/r/lnpbp/lnpd
- Clone this repository and change to its dir:
git clone https://github.com/LNP-BP/docker cd docker/docker-compose
- Go to the
mainnet
,signet
ortestnet
directory and performdocker-compose up
command
Now you will have bitcoind, lightningd, electrs and elementsd (for mainnet version only) running with JSON-RPC interface opened for the local machine.
To modify the default JSON-RPC user name, password, IP addresses and other
options edit command
and env
sections in a used docker-compose.yml
file
- When you do not need to expose RPC ports to the external world leave them exposed only through docker-compose
expose
but notport
command. - In docker-compose connectivity always rely on internal network only; since there might be alternative compose files using same ports on the same IP addresses (for instance for scalability purposes).
- Customize as much as possible with
ARG
variables. - Structure
ENTRYPOINT
in a way that it can be extended with composecommand
args later. - For RPC use macaroons/files whenever possible (not implemented yet, needs a separate issue).
- Run container processes using an unprivileged user instead of root.
The most simple way of using tools is to create aliases:
alias bitcoin-cli='docker exec bitcoind-mainnet bitcoin-cli --datadir=/var/lib/bitcoin -rpcpassword=bitcoin -rpcuser=bitcoin'
alias lightning-cli='docker exec lightningd-mainnet lightning-cli --lightning-dir=/var/lib/lightning --mainnet --lightning-dir /var/lib/lightning'
alias liquid-cli='docker exec elementsd-liquidv1 elements-cli --datadir=/var/lib/elements -chain=liquidv1 -rpcuser=bitcoin -rpcpassword=bitcoin'
alias signet-cli='docker exec bitcoind-signet bitcoin-cli --datadir=/var/lib/bitcoin --signet -rpcpassword=bitcoin -rpcuser=bitcoin'
alias sightning-cli='docker exec lightningd-signet lightning-cli --lightning-dir=/var/lib/lightning --signet --lightning-dir /var/lib/lightning'
alias rgb-cli='docker exec rgbd-signet rgb-cli -n signet'
alias lnp-cli='docker exec lnpd-signet lnp-cli -n signet -d /var/lib/lnp'
- Bitcoin Core: we disable wallet in the release build, but leaving it for
nightly builds such it will be possible to play with signet & testnet
transactions.
- latest & version tagged:
docker build Dockerfile/bitcoind --build-arg VERSION=<version> --build-arg DISABLE_WALLET=
- nightly build:
docker build Dockerfile/bitcoind
- latest & version tagged:
- c-Lightning: nightly version has developer features enabled and is built
with bitcoin-cli coming from the nightly Bitcoin Core build
- latest & version tagged:
docker build Dockerfile/lightningd --build-arg VERSION=<version>
- nightly build:
docker build Dockerfile/lightningd --build-arg BITCOIN_VERSION=nightly --build-arg DEVELOPER=true
- latest & version tagged:
- Elements: since there is not a lot of liquid-enabled wallets, here we
enable wallet in all builds
- latest & version tagged:
docker build Dockerfile/elementsd --build-arg VERSION=<version>
- nightly build:
docker build Dockerfile/elementsd
- latest & version tagged:
- Electrs:
- latest & version tagged:
docker build Dockerfile/electrs --build-arg VERSION=<version>
- nightly build:
docker build Dockerfile/electrs
- latest & version tagged:
- RGB Node:
- latest && version tagged:
docker build Dockerfile/rgb-node --build-arg VERSION=<version>
- nightly build:
docker build Dockerfile/rgb-node
- latest && version tagged:
- LNP Node:
- latest && version tagged:
docker build Dockerfile/lnp-node --build-arg VERSION=<version>
- nightly build:
docker build Dockerfile/lnp-node
- latest && version tagged:
If you are planning to create your own docker image builds, remember the following:
- you need to specify
VERSION
arg value to the docker if you'd like to build a specific version; otherwise/by default docker will build the latest
master (=nightly build) - you need to set
DISABLE_WALLET
arg to an empty string if you'd like the build to include wallet functionality:docker build . --build-arg DISABLE_WALLET=
If this argument is not provided bitcoin core is built with wallet backed by the new (5th) version of BerkleyDB storage, meaning that old Bitcoin Core wallets can't be imported.
You can use your existing bitcoin blockchain directory using the following steps:
- Create docker volume pointing to it with
where
docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/bitcoin \ bitcoin docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/lightning \ lightning docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/elements \ elements docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/electrs \ electrs docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/rgb \ rgb docker volume create --driver local \ --opt o=bind \ --opt type=none \ --opt device=/var/lib/lnp \ lnp
/var/lib/bitcoin
etc must be replaced with your destination directories - Edit
docker-compose/.env
file paths - When starting docker-compose from within an appropriate
docker-compose.yml
file directory provide it with-env=../.env
option
Execute the following command:
docker run \
-p 8332:8332 -p 8333:8333 \
-v /var/lib/bitcoin:bitcoin \
--name bitcoind \
lnpbp/bitcoind:latest
with replacing /var/lib/bitcoin
with the desired location for the blockchain
data.