forked from lightninglabs/aperture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 1.07 KB
/
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
31
32
33
34
35
36
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"
# Install dependencies and install/build aperture
RUN apk add --no-cache --update alpine-sdk \
git \
make \
&& git clone https://github.com/lightninglabs/aperture /go/src/github.com/lightninglabs/aperture \
&& cd /go/src/github.com/lightninglabs/aperture \
&& git checkout $checkout \
&& make install
# Start a new, final image to reduce size.
FROM alpine as final
# Expose aperture ports
EXPOSE 11010
# Copy the binaries and entrypoint from the builder image.
COPY --from=builder /go/bin/aperture /bin/
# Add bash.
RUN apk add --no-cache \
bash \
ca-certificates
# Specify the start command and entrypoint as the aperture daemon.
ENTRYPOINT ["aperture"]