build: add release-install goal, hash individual binaries

We add a new make goal called release-install that creates the same
reproducible binaries as the release script would create, but only for
the current OS/architecture. It then installs those binaries to the
system's GOBIN directory.
To allow easy verification of individual binaries (instead of just the
packag tarballs/zips), we also add the hashes of lnd and lncli binaries
to the manifest. We do the same in the docker build.
This commit is contained in:
Oliver Gugger
2021-01-13 14:26:29 +01:00
parent f057f2c485
commit 25ac071300
3 changed files with 19 additions and 3 deletions

View File

@@ -23,8 +23,7 @@ RUN apk add --no-cache --update alpine-sdk \
&& git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd \
&& cd /go/src/github.com/lightningnetwork/lnd \
&& git checkout $checkout \
&& make \
&& make install tags="signrpc walletrpc chainrpc invoicesrpc"
&& make release-install
# Start a new, final image.
FROM alpine as final
@@ -42,6 +41,11 @@ RUN apk --no-cache add \
COPY --from=builder /go/bin/lncli /bin/
COPY --from=builder /go/bin/lnd /bin/
# 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