2023-02-09 10:02:27 +00:00
|
|
|
FROM --platform=${BUILDPLATFORM} golang:1.18-alpine as builder
|
2019-05-18 01:40:43 +00:00
|
|
|
|
|
|
|
# Copy in the local repository to build from.
|
|
|
|
COPY . /go/src/github.com/lightningnetwork/loop
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Explicitly turn on the use of modules (until this becomes the default).
|
|
|
|
ENV GO111MODULE on
|
|
|
|
|
|
|
|
# Install dependencies and install/build lnd.
|
|
|
|
RUN apk add --no-cache --update alpine-sdk \
|
|
|
|
git \
|
|
|
|
make \
|
2021-03-05 09:07:28 +00:00
|
|
|
&& cd /go/src/github.com/lightningnetwork/loop \
|
|
|
|
&& make install
|
2019-05-18 01:40:43 +00:00
|
|
|
|
|
|
|
# Start a new, final image to reduce size.
|
2022-04-14 14:59:49 +00:00
|
|
|
FROM --platform=${BUILDPLATFORM} alpine as final
|
2019-05-18 01:40:43 +00:00
|
|
|
|
|
|
|
# Expose lnd ports (server, rpc).
|
|
|
|
EXPOSE 8081 11010
|
|
|
|
|
|
|
|
# Copy the binaries and entrypoint from the builder image.
|
|
|
|
COPY --from=builder /go/bin/loopd /bin/
|
|
|
|
COPY --from=builder /go/bin/loop /bin/
|
|
|
|
|
|
|
|
# Add bash.
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
ca-certificates
|