2019-09-18 14:29:40 +03:00
|
|
|
FROM golang:1.13-alpine as builder
|
2016-07-17 03:55:16 +03:00
|
|
|
|
2019-11-20 05:06:17 +03:00
|
|
|
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
|
2016-07-17 03:55:16 +03:00
|
|
|
|
2016-08-30 01:17:48 +03: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
|
|
|
|
|
2018-05-02 06:55:40 +03:00
|
|
|
# Install dependencies and install/build lnd.
|
2018-12-02 21:45:23 +03:00
|
|
|
RUN apk add --no-cache --update alpine-sdk \
|
2018-05-02 06:55:40 +03:00
|
|
|
git \
|
2019-02-07 00:38:15 +03:00
|
|
|
make
|
|
|
|
|
|
|
|
# Copy in the local repository to build from.
|
|
|
|
COPY . /go/src/github.com/lightningnetwork/lnd
|
|
|
|
|
|
|
|
RUN cd /go/src/github.com/lightningnetwork/lnd \
|
2018-05-19 06:47:44 +03:00
|
|
|
&& make \
|
2019-06-27 12:33:16 +03:00
|
|
|
&& make install tags="signrpc walletrpc chainrpc invoicesrpc routerrpc"
|
2016-08-30 01:17:48 +03:00
|
|
|
|
2018-05-02 06:55:40 +03:00
|
|
|
# Start a new, final image to reduce size.
|
|
|
|
FROM alpine as final
|
2017-01-18 02:33:01 +03:00
|
|
|
|
2018-05-02 06:55:40 +03:00
|
|
|
# Expose lnd ports (server, rpc).
|
|
|
|
EXPOSE 9735 10009
|
2017-01-18 02:33:01 +03:00
|
|
|
|
2018-05-02 06:55:40 +03:00
|
|
|
# Copy the binaries and entrypoint from the builder image.
|
2018-05-19 06:47:44 +03:00
|
|
|
COPY --from=builder /go/bin/lncli /bin/
|
|
|
|
COPY --from=builder /go/bin/lnd /bin/
|
2018-05-02 06:55:40 +03:00
|
|
|
|
|
|
|
# Add bash.
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash
|
2016-07-17 03:55:16 +03:00
|
|
|
|
2018-05-02 06:55:40 +03:00
|
|
|
# Copy the entrypoint script.
|
2017-01-12 03:12:32 +03:00
|
|
|
COPY "docker/lnd/start-lnd.sh" .
|
2017-01-22 17:44:15 +03:00
|
|
|
RUN chmod +x start-lnd.sh
|