Skip to content

Commit cf4fc1f

Browse files
authored
Merge pull request #16 from lightninglabs/dockerfile
docker: add default Dockerfile
2 parents 0849d0e + b6cf131 commit cf4fc1f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM golang:1.13-alpine as builder
2+
3+
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
4+
# queries required to connect to linked containers succeed.
5+
ENV GODEBUG netdns=cgo
6+
7+
ADD . /go/src/github.com/lightninglabs/governator
8+
9+
# Install dependencies and build the binaries.
10+
RUN apk add --no-cache --update alpine-sdk \
11+
git \
12+
make \
13+
gcc \
14+
&& cd /go/src/github.com/lightninglabs/governator \
15+
&& make \
16+
&& make install
17+
18+
# Start a new, final image.
19+
FROM alpine as final
20+
21+
# Add bash and ca-certs, for quality of life and SSL-related reasons.
22+
RUN apk --no-cache add \
23+
bash \
24+
ca-certificates
25+
26+
# Copy the binaries from the builder image.
27+
COPY --from=builder /go/bin/governator /bin/
28+
COPY --from=builder /go/bin/gvncli /bin/
29+
30+
# Expose governator ports (rpc).
31+
EXPOSE 8465
32+
33+
# Specify the start command and entrypoint as the governator daemon.
34+
ENTRYPOINT ["governator"]
35+

0 commit comments

Comments
 (0)