-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
34 lines (24 loc) · 833 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
31
32
33
34
FROM golang:1.19.4-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
# Explicitly turn on the use of modules (until this becomes the default).
ENV GO111MODULE on
# Install dependencies.
RUN apk add --no-cache --update alpine-sdk git make
# Build and install binary.
COPY . /go/src/github.com/hieblmi/go-host-lnaddr
RUN cd /go/src/github.com/hieblmi/go-host-lnaddr && go install ./...
# Start a new, final image to reduce size.
FROM alpine as final
# Expose port.
EXPOSE 9990
# Copy the binary from the builder image.
COPY --from=builder /go/bin/go-host-lnaddr /bin/
# Add bash.
RUN apk add --no-cache \
bash \
ca-certificates
RUN mkdir -p /app
WORKDIR /app
ENTRYPOINT ["go-host-lnaddr"]