forked from ardanlabs/service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile.metrics
26 lines (21 loc) · 911 Bytes
/
dockerfile.metrics
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/sidecar/metrics
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 3001
EXPOSE 4001
COPY --from=build /go/src/github.com/ardanlabs/service/cmd/sidecar/metrics/metrics /bin/
ENTRYPOINT ["/bin/metrics"]
LABEL org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.title="metrics" \
org.opencontainers.image.authors="William Kennedy <[email protected]>" \
org.opencontainers.image.source="https://github.com/ardanlabs/service/cmd/sidecar/metrics" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.vendor="Ardan Labs"