-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from lightninglabs/dockerfile
docker: add default Dockerfile
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:1.13-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 | ||
|
||
ADD . /go/src/github.com/lightninglabs/governator | ||
|
||
# Install dependencies and build the binaries. | ||
RUN apk add --no-cache --update alpine-sdk \ | ||
git \ | ||
make \ | ||
gcc \ | ||
&& cd /go/src/github.com/lightninglabs/governator \ | ||
&& make \ | ||
&& make install | ||
|
||
# Start a new, final image. | ||
FROM alpine as final | ||
|
||
# Add bash and ca-certs, for quality of life and SSL-related reasons. | ||
RUN apk --no-cache add \ | ||
bash \ | ||
ca-certificates | ||
|
||
# Copy the binaries from the builder image. | ||
COPY --from=builder /go/bin/governator /bin/ | ||
COPY --from=builder /go/bin/gvncli /bin/ | ||
|
||
# Expose governator ports (rpc). | ||
EXPOSE 8465 | ||
|
||
# Specify the start command and entrypoint as the governator daemon. | ||
ENTRYPOINT ["governator"] | ||
|