-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adam Hughes
committed
Feb 25, 2020
1 parent
5c339b1
commit 09653bc
Showing
1 changed file
with
14 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,14 @@ | ||
ARG GOLANG_TAG=1.13-alpine | ||
|
||
FROM golang:$GOLANG_TAG as build-stage | ||
RUN apk add --no-cache git ca-certificates && update-ca-certificates | ||
WORKDIR /src | ||
COPY . . | ||
RUN CGO_ENABLED=0 go install -ldflags "-s -w -X main.version=`git describe --long --dirty --always`" ./cmd/server/... | ||
|
||
FROM scratch | ||
COPY --from=build-stage /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=build-stage /go/bin/server /usr/local/bin/ | ||
USER 1000 | ||
EXPOSE 8080/tcp | ||
ENTRYPOINT ["server"] |