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