-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
30 lines (24 loc) · 1005 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARG GO_VERSION=1.22.6
ARG BASE_IMAGE=lightninglabs/lnd
ARG BASE_IMAGE_VERSION=v0.18.4-beta
FROM golang:${GO_VERSION}-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
# main by default.
ARG checkout="main"
ARG git_url="https://github.com/lightninglabs/lndinit"
# Install dependencies and build the binaries.
RUN apk add --no-cache --update alpine-sdk \
git \
make \
&& git clone $git_url /go/src/github.com/lightninglabs/lndinit \
&& cd /go/src/github.com/lightninglabs/lndinit \
&& git checkout $checkout \
&& make release-install
# Start a new, final image.
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} as final
# Copy the binary from the builder image.
COPY --from=builder /go/bin/lndinit /bin/