-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (42 loc) · 2.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM alpine:3.21
# buildx automatic ARG
ARG TARGETARCH
ARG FLUX_VERSION=2.4.0
ARG KUBECONFORM_VERSION=0.6.7
ARG KUBERNETES_VERSION=1.32.1
ARG KUSTOMIZE_VERSION=5.4.3
ARG SOPS_VERSION=3.9.4
ARG FILENAME_FORMAT='{kind}-{group}-{version}'
WORKDIR /tmp
RUN mkdir ~/.gnupg
RUN apk add --no-cache --update \
curl bash gnupg parallel shellcheck \
python3 py3-pip py3-yaml npm yq git
COPY secrets/base/private.key private.key
RUN gpg --import private.key
RUN npm install -g prettier
RUN curl -LO https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-${TARGETARCH}.tar.gz && \
tar xf kubeconform-linux-${TARGETARCH}.tar.gz -C /usr/local/bin && \
rm kubeconform-linux-${TARGETARCH}.tar.gz
RUN curl -L https://dl.k8s.io/release/v${KUBERNETES_VERSION}/bin/linux/${TARGETARCH}/kubectl -o /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl
RUN curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh \
| bash -s ${KUSTOMIZE_VERSION} && \
mv kustomize /usr/local/bin
RUN curl -LO https://github.com/fluxcd/flux2/releases/download/v${FLUX_VERSION}/flux_${FLUX_VERSION}_linux_${TARGETARCH}.tar.gz && \
tar xf flux_${FLUX_VERSION}_linux_${TARGETARCH}.tar.gz -C /usr/local/bin && \
rm flux_${FLUX_VERSION}_linux_${TARGETARCH}.tar.gz
RUN curl -L https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.${TARGETARCH} -o /usr/local/bin/sops && \
chmod +x /usr/local/bin/sops
RUN git clone -n --depth=1 --filter=tree:0 https://github.com/yannh/kubernetes-json-schema /kubernetes-json-schemas && \
cd /kubernetes-json-schemas && \
git sparse-checkout set --no-cone v${KUBERNETES_VERSION}-standalone && \
git checkout && mv v${KUBERNETES_VERSION}-standalone master-standalone
RUN curl -LO https://github.com/fluxcd/flux2/releases/download/v${FLUX_VERSION}/crd-schemas.tar.gz && \
tar xf crd-schemas.tar.gz -C /kubernetes-json-schemas/master-standalone && \
rm crd-schemas.tar.gz
COPY crds crds
RUN curl -LO https://raw.githubusercontent.com/yannh/kubeconform/master/scripts/openapi2jsonschema.py && \
python3 openapi2jsonschema.py crds/**/*.yaml && \
mv *.json /kubernetes-json-schemas/master-standalone
WORKDIR /build