mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
7692ced5f5
Since we now have a scripted check that makes sure the Golang version is synced throughout all files, it is important that the main version in the Makefile is changed, then all other versions can be detected by that script.
56 lines
1.8 KiB
Docker
56 lines
1.8 KiB
Docker
# If you change this please also update GO_VERSION in Makefile (then run
|
|
# `make lint` to see where else it needs to be updated as well).
|
|
FROM golang:1.22.6-alpine as builder
|
|
|
|
# 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"
|
|
ARG git_url="https://github.com/lightningnetwork/lnd"
|
|
|
|
# Install dependencies and build the binaries.
|
|
RUN apk add --no-cache --update alpine-sdk \
|
|
git \
|
|
make \
|
|
gcc \
|
|
&& git clone $git_url /go/src/github.com/lightningnetwork/lnd \
|
|
&& cd /go/src/github.com/lightningnetwork/lnd \
|
|
&& git checkout $checkout \
|
|
&& make release-install
|
|
|
|
# Start a new, final image.
|
|
FROM alpine as final
|
|
|
|
# Define a root volume for data persistence.
|
|
VOLUME /root/.lnd
|
|
|
|
# Add utilities for quality of life and SSL-related reasons. We also require
|
|
# curl and gpg for the signature verification script.
|
|
RUN apk --no-cache add \
|
|
bash \
|
|
jq \
|
|
ca-certificates \
|
|
gnupg \
|
|
curl
|
|
|
|
# Copy the binaries from the builder image.
|
|
COPY --from=builder /go/bin/lncli /bin/
|
|
COPY --from=builder /go/bin/lnd /bin/
|
|
COPY --from=builder /go/src/github.com/lightningnetwork/lnd/scripts/verify-install.sh /
|
|
COPY --from=builder /go/src/github.com/lightningnetwork/lnd/scripts/keys/* /keys/
|
|
|
|
# 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
|
|
|
|
# Expose lnd ports (p2p, rpc).
|
|
EXPOSE 9735 10009
|
|
|
|
# Specify the start command and entrypoint as the lnd daemon.
|
|
ENTRYPOINT ["lnd"]
|