-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 740 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 740 Bytes
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
############################
# STAGE 1
############################
FROM golang:alpine AS builder
RUN apk --update add --no-cache ca-certificates openssl git tzdata && \
update-ca-certificates
RUN mkdir -p /build
WORKDIR /build
# Copy all files over
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -o spot-interruption-exporter
############################
# STAGE 2
############################
FROM scratch
# Copy all certificates
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copies the built binary over from the previous stage
COPY --from=builder /build/spot-interruption-exporter /go/bin/spot-interruption-exporter
# Run the binary
ENTRYPOINT ["/go/bin/spot-interruption-exporter"]