Skip to content

Commit a2ab974

Browse files
committed
Docker the new dockerfile
1 parent 3ab73e2 commit a2ab974

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,78 @@ For the impatient here's the gist of it for Ubuntu and Debian:
6363
cd lightning
6464
make
6565

66-
Or if you like to throw `docker` into the mix:
66+
Or if you like to throw `docker` into the mix, you have the choice with two different docker images:
67+
68+
The first docker image is [cdecker/lightningd](https://hub.docker.com/r/cdecker/lightningd/), it provides c-lightning with a bundled bitcoin core:
6769

6870
sudo docker run \
6971
-v $HOME/.lightning:/root/.lightning \
7072
-v $HOME/.bitcoin:/root/.bitcoin \
7173
-p 9735:9735 \
7274
cdecker/lightningd:latest
7375

76+
The second docker image is [elementsproject/lightning](https://hub.docker.com/r/elementsproject/lightningd/) (from this [Dockerfile](Dockerfile)), it is meant to be used inside docker-compose.
77+
78+
It has the following environment variable:
79+
80+
* `EXPOSE_TCP` default to false, if true, use expose c-lightning on port 9835. (Use this only for testing)
81+
* `LIGHTNINGD_OPT` is the content of the config file of the clightning instance.
82+
83+
On top of this, to make configuration easier, if `LIGHTNINGD_OPT` contains the parameter `chain=`, then, the `network=` parameter will be rewritten before starting c-lightning:
84+
85+
| chain= | network= | New network= |
86+
|---|---|---|
87+
| btc | mainnet | bitcoin |
88+
| btc | testnet | testnet |
89+
| btc | regtest | regtest |
90+
| ltc | mainnet | litecoin |
91+
| ltc | testnet | litecoin-testnet |
92+
93+
Here is an example of a docker-compose file with litecoind and c-lightning on `testnet` which expose litecoin's rpc interface on port `32610` and c-lightning API on port `32611`:
94+
95+
```
96+
version: "3"
97+
98+
litecoind:
99+
image: nicolasdorier/docker-litecoin:0.15.1
100+
environment:
101+
BITCOIN_EXTRA_ARGS: |
102+
testnet=1
103+
whitelist=0.0.0.0/0
104+
rpcport=43782
105+
server=1
106+
ports:
107+
- "32610:43782"
108+
expose:
109+
- "43782"
110+
volumes:
111+
- "litecoin_datadir:/data"
112+
113+
clightning_litecoin:
114+
image: elementsproject/lightning
115+
environment:
116+
EXPOSE_TCP: "true"
117+
LIGHTNINGD_OPT: |
118+
bitcoin-datadir=/etc/litecoin
119+
bitcoin-rpcconnect=litecoind
120+
network=testnet
121+
alias=myawesomenode
122+
chain=ltc
123+
ports:
124+
- "32611:9835"
125+
expose:
126+
- "9835"
127+
volumes:
128+
- "clightning_litecoin_datadir:/root/.lightning"
129+
- "litecoin_datadir:/etc/litecoin"
130+
links:
131+
- litecoind
132+
133+
volumes:
134+
litecoin_datadir:
135+
clightning_litecoin_datadir:
136+
```
137+
74138
### Starting `lightningd`
75139

76140
In order to start `lightningd` you will need to have a local `bitcoind`

0 commit comments

Comments
 (0)