-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
25 lines (20 loc) · 667 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
FROM golang:1.19-alpine as builder
WORKDIR /go/src/github.com/jetstack/paranoia
# Download necessary Go modules
COPY ./go.mod ./
COPY ./go.sum ./
RUN go mod download
# Copy the files into the container
COPY main.go main.go
COPY ./cmd cmd
COPY ./internal internal
# Setup tmp directory
RUN mkdir /new_tmp
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o paranoia .
# Build tiny container
FROM scratch
COPY --from=builder /new_tmp /tmp
COPY --from=builder /go/src/github.com/jetstack/paranoia/paranoia .
ADD https://cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem /etc/ssl/certs/DigiCertGlobalRootCA.crt
ENTRYPOINT ["/paranoia"]