Files
lnd.xprv/Dockerfile
T

43 lines
1.3 KiB
Docker
Raw Normal View History

2020-07-16 17:19:53 -07:00
FROM golang:1.14.5-alpine as builder
2018-05-16 21:50:25 -04:00
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo
# Pass a tag, branch or a commit using build-arg. This allows a docker
# image to be built from a specified Git state. The default image
# will use the Git tip of master by default.
ARG checkout="master"
2018-05-16 21:50:25 -04:00
# Install dependencies and build the binaries.
2018-12-01 22:53:14 -06:00
RUN apk add --no-cache --update alpine-sdk \
2018-05-16 21:50:25 -04:00
git \
make \
2018-12-01 22:53:14 -06:00
gcc \
2018-05-16 21:50:25 -04:00
&& git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd \
&& cd /go/src/github.com/lightningnetwork/lnd \
&& git checkout $checkout \
2018-05-16 21:50:25 -04:00
&& make \
&& make install tags="signrpc walletrpc chainrpc invoicesrpc"
2018-05-16 21:50:25 -04:00
# Start a new, final image.
FROM alpine as final
# Define a root volume for data persistence.
VOLUME /root/.lnd
# Add bash, jq and ca-certs, for quality of life and SSL-related reasons.
2018-05-16 21:50:25 -04:00
RUN apk --no-cache add \
bash \
jq \
2018-05-16 21:50:25 -04:00
ca-certificates
# Copy the binaries from the builder image.
COPY --from=builder /go/bin/lncli /bin/
COPY --from=builder /go/bin/lnd /bin/
# Expose lnd ports (p2p, rpc).
EXPOSE 9735 10009
2018-05-16 21:50:25 -04:00
# Specify the start command and entrypoint as the lnd daemon.
ENTRYPOINT ["lnd"]