Skip to content

Commit a9ad8b4

Browse files
committed
Add ca certificates to docker image
1 parent 798e99c commit a9ad8b4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
FROM golang:1.14 AS builder
2-
3-
RUN mkdir -p github.com/yannh/kubeconform
4-
COPY . github.com/yannh/kubeconform/
5-
WORKDIR github.com/yannh/kubeconform
6-
RUN make build-static
1+
FROM alpine:latest as certs
2+
RUN apk add ca-certificates
73

84
FROM scratch AS kubeconform
95
MAINTAINER Yann HAMON <[email protected]>
10-
COPY --from=builder /go/github.com/yannh/kubeconform/bin/kubeconform /
6+
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
7+
COPY bin/kubeconform /
118
ENTRYPOINT ["/kubeconform"]

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/make -f
22

3-
.PHONY: test-build test build build-static docker-test docker-build-static build-bats docker-acceptance
3+
.PHONY: test-build test build build-static docker-test docker-build-static build-bats docker-acceptance docker-image
44

55
test-build: test build
66

@@ -10,6 +10,9 @@ test:
1010
build:
1111
go build -o bin/kubeconform
1212

13+
docker-image:
14+
docker build -t kubeconform .
15+
1316
build-static:
1417
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeconform
1518

0 commit comments

Comments
 (0)