forked from derailed/popeye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (20 loc) · 792 Bytes
/
Dockerfile
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
# -----------------------------------------------------------------------------
# Build...
FROM golang:1.13.5-alpine AS build
ENV VERSION=v0.8.0 GO111MODULE=on PACKAGE=github.com/derailed/popeye
WORKDIR /go/src/$PACKAGE
COPY go.mod go.sum main.go ./
COPY internal internal
COPY types types
COPY pkg pkg
COPY cmd cmd
RUN apk update && apk upgrade ;\
apk --no-cache add git ca-certificates ;\
CGO_ENABLED=0 GOOS=linux go build -o /go/bin/popeye \
-trimpath -ldflags="-w -s -X $PACKAGE/cmd.version=$VERSION" *.go
# -----------------------------------------------------------------------------
# Image...
FROM alpine:3.11.2
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /go/bin/popeye /bin/popeye
ENTRYPOINT [ "/bin/popeye" ]