diff --git a/Dockerfile b/Dockerfile index b4bfa98..7a74d48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 -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"] \ No newline at end of file diff --git a/Makefile b/Makefile index 6936c86..db29770 100644 --- a/Makefile +++ b/Makefile @@ -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