-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
ef83b82
commit 802d56d
Showing
1 changed file
with
16 additions
and
3 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 |
---|---|---|
@@ -1,16 +1,29 @@ | ||
FROM golang:1.10-alpine as go | ||
|
||
WORKDIR /go/src/text-server | ||
# args | ||
ARG version="1.0.0" | ||
|
||
# source | ||
WORKDIR $GOPATH/src/text-server | ||
COPY . . | ||
|
||
# build | ||
ENV CGO_ENABLED=0 | ||
ENV GOOS=linux | ||
ENV GOARCH=amd64 | ||
RUN go build -ldflags '-extldflags "-static"' -o text-server | ||
RUN go build -ldflags "-s -w" -o /text-server | ||
|
||
|
||
FROM scratch | ||
|
||
# labels | ||
LABEL org.label-schema.vcs-url="https://github.com/productionwentdown/text-server" | ||
LABEL org.label-schema.version=${version} | ||
LABEL org.label-schema.schema-version="1.0" | ||
|
||
# copy binary | ||
COPY --from=go /text-server /text-server | ||
|
||
EXPOSE 8080 | ||
COPY --from=go /go/src/text-server/text-server text-server | ||
|
||
ENTRYPOINT ["/text-server"] |