-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (23 loc) · 868 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
26
27
28
29
30
31
32
33
34
35
ARG GO_VERSION=1.15
FROM golang:${GO_VERSION}-alpine AS builder
ARG VERSION
ARG COMMIT
RUN apk add --update --no-cache ca-certificates make git curl
RUN mkdir -p /build
WORKDIR /build
ARG GOPROXY
RUN mkdir -p /build
WORKDIR /build
COPY go.* /build/
RUN go mod download
COPY . /build
RUN go build -ldflags="-X github.com/innovia/secrets-consumer-webhook/version.version=${VERSION} -X github.com/innovia/secrets-consumer-webhook/version.gitCommitID=${COMMIT}"
RUN cp secrets-consumer-webhook /usr/local/bin/
RUN chmod a+x /usr/local/bin/secrets-consumer-webhook
FROM alpine
RUN apk add --update libcap && rm -rf /var/cache/apk/*
COPY --from=builder /usr/local/bin/secrets-consumer-webhook /usr/local/bin/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENV DEBUG false
USER 65534
ENTRYPOINT ["/usr/local/bin/secrets-consumer-webhook"]