2019-04-29 16:55:26 +00:00
|
|
|
FROM golang:1.12.4-alpine AS build_deps
|
2019-04-14 20:18:24 +00:00
|
|
|
|
2019-04-29 16:55:26 +00:00
|
|
|
RUN apk add --no-cache git
|
2019-04-14 20:18:24 +00:00
|
|
|
|
|
|
|
WORKDIR /workspace
|
2019-04-29 16:55:26 +00:00
|
|
|
ENV GO111MODULE=on
|
2019-04-14 20:18:24 +00:00
|
|
|
|
2019-04-29 16:55:26 +00:00
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
FROM build_deps AS build
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
|
|
|
|
|
|
|
|
FROM alpine:3.9
|
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
|
|
|
COPY --from=build /workspace/webhook /usr/local/bin/webhook
|
|
|
|
|
|
|
|
ENTRYPOINT ["webhook"]
|