forked from ardanlabs/service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile.sales-api
26 lines (21 loc) · 900 Bytes
/
dockerfile.sales-api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Build the Go Binary.
FROM golang:1.10.3 as build
ENV CGO_ENABLED 0
RUN mkdir -p /go/src/github.com/ardanlabs/service
COPY . /go/src/github.com/ardanlabs/service
WORKDIR /go/src/github.com/ardanlabs/service/cmd/sales-api
RUN go build -ldflags "-s -w -X main.build=$(git rev-parse HEAD)" -a -tags netgo
# Run the Go Binary in Alpine.
FROM alpine:3.7
ARG BUILD_DATE
ARG VCS_REF
EXPOSE 3000
EXPOSE 4000
COPY --from=build /go/src/github.com/ardanlabs/service/cmd/sales-api/sales-api /bin/
ENTRYPOINT ["/bin/sales-api"]
LABEL org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.title="sales-api" \
org.opencontainers.image.authors="William Kennedy <[email protected]>" \
org.opencontainers.image.source="https://github.com/ardanlabs/service/cmd/sales-api" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.vendor="Ardan Labs"