forked from controlplaneio/kubesec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.scratch
23 lines (19 loc) · 894 Bytes
/
Dockerfile.scratch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:1.12-alpine AS builder
WORKDIR /go/src/github.com/controlplaneio/kubesec
RUN wget https://raw.githubusercontent.com/golang/dep/master/install.sh -O- | sh && \
apk add --no-cache git ca-certificates
COPY . .
RUN dep ensure -v -vendor-only && \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubesec ./cmd/kubesec/*
RUN echo "kubesec:x:31012:31012:kubesec:/home/kubesec:/sbin/nologin" > /passwd && \
echo "kubesec:x:31012:" > /group
# ===
FROM scratch
WORKDIR /home/kubesec
COPY --from=stefanprodan/kubernetes-json-schema:latest /schemas/master-standalone /schemas/kubernetes-json-schema/master/master-standalone
COPY --from=builder /go/src/github.com/controlplaneio/kubesec/kubesec .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /passwd /group /etc/
USER kubesec
ENTRYPOINT ["./kubesec"]
CMD ["http", "8080"]