2
0
mirror of https://github.com/lnbook/lnbook synced 2024-11-01 03:20:53 +00:00
lnbook/code/docker/lnd/Dockerfile
2020-12-11 17:51:51 +02:00

50 lines
1.2 KiB
Docker

FROM golang:1.13 as lnd-base
ENV GOPATH /go
WORKDIR $GOPATH/src
# LND
ENV LND_VER v0.11.1-beta
RUN go get -d github.com/lightningnetwork/lnd
WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd
RUN git checkout tags/${LND_VER}
RUN make && make install
FROM ubuntu:20.04 AS lnd-run
RUN apt update && apt install -yqq \
curl gosu jq bash-completion
COPY --from=lnd-base /go /go
COPY --from=lnbook/bitcoind /usr/local/ /usr/local/
RUN cp /go/src/github.com/lightningnetwork/lnd/contrib/lncli.bash-completion \
/usr/share/bash-completion/completions/lncli
ENV GOPATH /go
ENV PATH $PATH:$GOPATH/bin
ADD lnd /lnd
RUN ln -s /lnd /root/.lnd
ADD fund-lnd.sh /usr/local/bin
RUN chmod +x /usr/local/bin/fund-lnd.sh
ADD bashrc /root/.bashrc
ADD lnd-entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/lnd-entrypoint.sh
ADD logtail.sh /usr/local/bin
RUN chmod +x /usr/local/bin/logtail.sh
ADD wait-for-bitcoind.sh /usr/local/bin
RUN chmod +x /usr/local/bin/wait-for-bitcoind.sh
# LND RPC
EXPOSE 10009/tcp
# LND P2P
EXPOSE 9735/tcp
WORKDIR /lnd
ENTRYPOINT ["/usr/local/bin/lnd-entrypoint.sh"]
# Show logs from beginning and keep following
CMD ["/usr/local/bin/logtail.sh"]