Skip to content

Commit 79fe113

Browse files
authored
Merge pull request puppetlabs#605 from deric/cfssl
Reproducible kube-tool build
2 parents 5dab58d + 51de989 commit 79fe113

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

tooling/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
FROM golang:1.19.2-alpine3.16
1+
FROM golang:1.19-alpine3.16
22

33
ENV USER root
44

55
RUN set -x && \
6-
apk --no-cache add git gcc make libc-dev && \
7-
git clone https://github.com/cloudflare/cfssl.git /go/src/github.com/cloudflare/cfssl && \
8-
cd /go/src/github.com/cloudflare/cfssl && \
9-
make && \
10-
git clone https://github.com/cloudflare/cfssl_trust.git /go/src/github.com/cloudflare/cfssl_trust && \
6+
apk --no-cache add gcc libc-dev && \
7+
go install github.com/cloudflare/cfssl/cmd/[email protected] && \
8+
go install github.com/cloudflare/cfssl_trust/...@latest && \
119
echo "Build complete."
1210

1311
FROM ruby:3.0-alpine3.16
14-
COPY --from=0 /go/src/github.com/cloudflare/cfssl_trust /etc/cfssl
15-
COPY --from=0 /go/src/github.com/cloudflare/cfssl/bin/ /usr/bin
12+
RUN mkdir /etc/cfssl
13+
COPY --from=0 /go/pkg/mod/github.com/cloudflare/cfssl_trust@*/*.crt* /etc/cfssl/
14+
COPY --from=0 /go/bin/ /usr/bin/
1615
RUN gem install slop
1716
COPY . /etc/k8s
1817

tooling/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
NAME=puppet/kubetool
2+
3+
all: build
4+
5+
.phony: build
6+
7+
build:
8+
grep "^FROM" Dockerfile | awk '{ print $$2 }' | uniq | xargs -P2 -n1 docker pull
9+
docker build -t $(NAME) .

0 commit comments

Comments
 (0)