1
0
Fork 0
text-server/Dockerfile

30 lines
506 B
Docker
Raw Normal View History

2018-02-26 22:20:37 +08:00
FROM golang:1.10-alpine as go
2018-01-11 17:13:31 +08:00
2018-09-17 12:00:54 +08:00
# args
ARG version="1.0.0"
# source
WORKDIR $GOPATH/src/text-server
2018-01-11 17:13:31 +08:00
COPY . .
2018-09-17 12:00:54 +08:00
# build
2018-01-11 17:13:31 +08:00
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
2018-09-17 12:00:54 +08:00
RUN go build -ldflags "-s -w" -o /text-server
2018-01-11 17:13:31 +08:00
FROM scratch
2018-09-17 12:00:54 +08:00
# 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
2018-01-11 17:13:31 +08:00
EXPOSE 8080
ENTRYPOINT ["/text-server"]