Skip to content

Commit

Permalink
Add ca certificates to docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
yannh committed Jun 7, 2020
1 parent 798e99c commit a9ad8b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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"]
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand Down

0 comments on commit a9ad8b4

Please sign in to comment.