github.com/decred/dcrlnd@v0.7.6/Dockerfile (about) 1 FROM golang:1.20-alpine as builder 2 3 # Force Go to use the cgo based DNS resolver. This is required to ensure DNS 4 # queries required to connect to linked containers succeed. 5 ENV GODEBUG netdns=cgo 6 7 # Install dependencies and build the binaries. 8 RUN apk add --no-cache --update alpine-sdk \ 9 git \ 10 make \ 11 gcc \ 12 && git clone https://github.com/decred/dcrlnd /go/src/github.com/decred/dcrlnd \ 13 && cd /go/src/github.com/decred/dcrlnd \ 14 && make \ 15 && make install 16 17 # Start a new, final image. 18 FROM alpine as final 19 20 # Define a root volume for data persistence. 21 VOLUME /root/.dcrlnd 22 23 # Add utilities for quality of life and SSL-related reasons. We also require 24 # curl and gpg for the signature verification script. 25 RUN apk --no-cache add \ 26 bash \ 27 jq \ 28 ca-certificates \ 29 gnupg \ 30 curl 31 32 # Copy the binaries from the builder image. 33 COPY --from=builder /go/bin/dcrlncli /bin/ 34 COPY --from=builder /go/bin/dcrlnd /bin/ 35 36 # Store the SHA256 hash of the binaries that were just produced for later 37 # verification. 38 RUN sha256sum /bin/dcrlnd /bin/dcrlncli > /shasums.txt \ 39 && cat /shasums.txt 40 41 # Expose lnd ports (p2p, rpc). 42 EXPOSE 9735 10009 43 44 # Specify the start command and entrypoint as the dcrlnd daemon. 45 ENTRYPOINT ["dcrlnd"]