2021-01-08 12:40:17 +03:00
|
|
|
# If you change this value, please change it in the following files as well:
|
|
|
|
# /.travis.yml
|
|
|
|
# /dev.Dockerfile
|
|
|
|
# /make/builder.Dockerfile
|
|
|
|
# /.github/workflows/main.yml
|
|
|
|
# /.github/workflows/release.yml
|
2021-02-17 03:18:35 +03:00
|
|
|
FROM golang:1.16.3-alpine as builder
|
2018-05-17 04:50:25 +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
|
|
|
|
|
2019-01-21 06:05:08 +03:00
|
|
|
# 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-17 04:50:25 +03:00
|
|
|
# Install dependencies and build the binaries.
|
2018-12-02 07:53:14 +03:00
|
|
|
RUN apk add --no-cache --update alpine-sdk \
|
2018-05-17 04:50:25 +03:00
|
|
|
git \
|
|
|
|
make \
|
2018-12-02 07:53:14 +03:00
|
|
|
gcc \
|
2018-05-17 04:50:25 +03:00
|
|
|
&& git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd \
|
|
|
|
&& cd /go/src/github.com/lightningnetwork/lnd \
|
2019-01-21 06:05:08 +03:00
|
|
|
&& git checkout $checkout \
|
2021-01-13 16:26:29 +03:00
|
|
|
&& make release-install
|
2018-05-17 04:50:25 +03:00
|
|
|
|
|
|
|
# Start a new, final image.
|
|
|
|
FROM alpine as final
|
|
|
|
|
|
|
|
# Define a root volume for data persistence.
|
|
|
|
VOLUME /root/.lnd
|
|
|
|
|
2021-01-13 16:55:54 +03:00
|
|
|
# Add utilities for quality of life and SSL-related reasons. We also require
|
|
|
|
# curl and gpg for the signature verification script.
|
2018-05-17 04:50:25 +03:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
bash \
|
2020-05-07 14:28:12 +03:00
|
|
|
jq \
|
2021-01-13 16:55:54 +03:00
|
|
|
ca-certificates \
|
|
|
|
gnupg \
|
|
|
|
curl
|
2018-05-17 04:50:25 +03:00
|
|
|
|
|
|
|
# Copy the binaries from the builder image.
|
|
|
|
COPY --from=builder /go/bin/lncli /bin/
|
|
|
|
COPY --from=builder /go/bin/lnd /bin/
|
2021-01-13 16:55:54 +03:00
|
|
|
COPY --from=builder /go/src/github.com/lightningnetwork/lnd/scripts/verify-install.sh /
|
2018-05-17 04:50:25 +03:00
|
|
|
|
2021-01-13 16:26:29 +03:00
|
|
|
# Store the SHA256 hash of the binaries that were just produced for later
|
|
|
|
# verification.
|
|
|
|
RUN sha256sum /bin/lnd /bin/lncli > /shasums.txt \
|
|
|
|
&& cat /shasums.txt
|
|
|
|
|
2018-11-14 16:12:20 +03:00
|
|
|
# Expose lnd ports (p2p, rpc).
|
|
|
|
EXPOSE 9735 10009
|
|
|
|
|
2018-05-17 04:50:25 +03:00
|
|
|
# Specify the start command and entrypoint as the lnd daemon.
|
|
|
|
ENTRYPOINT ["lnd"]
|