forked from cloudtools/cloudsweeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
19 lines (16 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
19 lines (16 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# STEP 1 build executable binary
FROM golang:1.10-alpine3.7 as builder
ADD . $GOPATH/src/github.com/cloudtools/cloudsweeper
WORKDIR $GOPATH/src/github.com/cloudtools/cloudsweeper
RUN apk -U upgrade && \
apk add --no-cache -U git && \
apk add --no-cache -U ca-certificates && \
update-ca-certificates && \
go get ./... && \
go test -cover ./... && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /cs cmd/cloudsweeper/*.go
FROM scratch
COPY --from=builder /cs /cs
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/ca-certificates/* /usr/share/ca-certificates/
ENTRYPOINT [ "/cs" ]