docker: Add a usable dockerfile#1616
Conversation
README.md
Outdated
| cdecker/lightningd:latest | ||
| It has the following environment variable: | ||
|
|
||
| * `EXPOSE_TCP` default to false, if true, use expose c-lightning on port 9835. (Use this only for testing) |
This is based on @NicolasDorier's excellent proposal for a Dockerfile, sans the writing of a config file. Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com> Co-authored-by: Christian Decker <decker.christian@gmail.com> Signed-off-by: Christian Decker <decker.christian@gmail.com>
| COPY . . | ||
|
|
||
| ARG DEVELOPER=0 | ||
| RUN ./configure && make -j3 DEVELOPER=${DEVELOPER} && cp lightningd/lightning* cli/lightning-cli /usr/bin/ |
There was a problem hiding this comment.
DEVELOPER=${DEVELOPER} is needed ? I thought with ./configure it should be ok.
There was a problem hiding this comment.
There's backward compatibility in case someone would set environment variable and then expect things to work.
| rm -rf glibc.apk glibc-bin.apk /var/cache/apk/* | ||
|
|
||
| ENV LIGHTNINGD_DATA=/root/.lightning | ||
| ENV LIGHTNINGD_PORT=9735 |
There was a problem hiding this comment.
Actually uneeded and can lead to confusion because actual port depends on the parameters passed to docker run.
There was a problem hiding this comment.
EDIT: It is actually used for socat.
There was a problem hiding this comment.
Still somewhat confusing, maybe rename it to something like RPC_TCP_PORT to make it distinct from the P2P network port?
edit: especially confusing with the default value being the p2p port...
There was a problem hiding this comment.
Yeah, sorry, my bad for mixing those two up :-(
| && tar -xzvf litecoin.tar.gz $BD/litecoin-cli --strip-components=1 --exclude=*-qt \ | ||
| && rm litecoin.tar.gz | ||
|
|
||
| ENV LIGHTNINGD_VERSION=master |
There was a problem hiding this comment.
LIGHTNINGD_VERSION is not used for anything
|
Should the entry point also start bitcoind if an external node isn't configured? Why are the bitcoin binaries included if not? |
|
@shesek because clightning depends on bitcoin-cli. |
|
Ah, I see, it's just the |
|
@shesek I don't think so. It makes the image two time bigger, also running two processes in one image is not recommended. |
This is based on @NicolasDorier's excellent proposal for a Dockerfile in PR #1318, sans the
writing of a config file.