Add ca certificates to docker image

This commit is contained in:
Yann Hamon 2020-06-07 13:14:17 +02:00
parent 798e99c50b
commit a9ad8b4290
2 changed files with 8 additions and 8 deletions

View file

@ -1,11 +1,8 @@
FROM golang:1.14 AS builder
RUN mkdir -p github.com/yannh/kubeconform
COPY . github.com/yannh/kubeconform/
WORKDIR github.com/yannh/kubeconform
RUN make build-static
FROM alpine:latest as certs
RUN apk add ca-certificates
FROM scratch AS kubeconform
MAINTAINER Yann HAMON <yann@mandragor.org>
COPY --from=builder /go/github.com/yannh/kubeconform/bin/kubeconform /
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY bin/kubeconform /
ENTRYPOINT ["/kubeconform"]

View file

@ -1,6 +1,6 @@
#!/usr/bin/make -f
.PHONY: test-build test build build-static docker-test docker-build-static build-bats docker-acceptance
.PHONY: test-build test build build-static docker-test docker-build-static build-bats docker-acceptance docker-image
test-build: test build
@ -10,6 +10,9 @@ test:
build:
go build -o bin/kubeconform
docker-image:
docker build -t kubeconform .
build-static:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeconform