-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
351 lines (313 loc) · 11.5 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# kics-scan disable=b03a748a-542d-44f4-bb86-9199ab4fd2d5
FROM docker.io/library/ubuntu:22.04@sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e496e5c1f05f
SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
ENV NO_UPDATE_NOTIFIER=true \
NODE_ENV=production \
PATH="$PATH:/root/node_modules/.bin"
WORKDIR /root
# hadolint ignore=DL3008
RUN <<EOF
apt-get update
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-recommends python3-pip git curl jq s3cmd
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y --no-install-recommends nodejs
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
COPY requirements.txt package*.json ./
RUN <<EOF
pip install --no-cache-dir -r requirements.txt
npm clean-install
EOF
# kubectl
COPY --from=docker.io/bitnami/kubectl:1.31.4@sha256:671516f53dd61f1e7d1dc178ba30d47faecc6caaa1e8c2a0f53d3d939f11c077 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl
RUN kubectl version --client
# Helm
# renovate: datasource=github-releases depName=helm/helm
ARG HELM_VERSION=3.16.3
ENV HELM_URL=https://get.helm.sh/helm-v"${HELM_VERSION}"-linux-amd64.tar.gz
RUN <<EOF
curl -LSs "$HELM_URL" | tar xz
mv linux-amd64/helm /usr/local/bin/helm
chmod +x /usr/local/bin/helm
helm version
EOF
# Helm push plugin
# renovate: datasource=github-releases depName=chartmuseum/helm-push
ARG HELM_PUSH_PLUGIN_VERSION=0.10.4
RUN <<EOF
helm plugin install --version=v${HELM_PUSH_PLUGIN_VERSION} https://github.com/chartmuseum/helm-push
helm cm-push --help
EOF
# Helm Local Chart Version Plugin
# renovate: datasource=github-releases depName=mbenabda/helm-local-chart-version
ARG HELM_LOCAL_CHART_VERSION_PLUGIN_VERSION=0.1.0
RUN <<EOF
helm plugin install --version=v${HELM_LOCAL_CHART_VERSION_PLUGIN_VERSION} https://github.com/mbenabda/helm-local-chart-version
helm local-chart-version version
EOF
# Helm schema plugin
# renovate: datasource=github-releases depName=dadav/helm-schema
ARG HELM_SCHEMA_GEN_PLUGIN_VERSION=0.16.1
RUN <<EOF
helm plugin install --version=v${HELM_SCHEMA_GEN_PLUGIN_VERSION} https://github.com/dadav/helm-schema
helm schema --help
EOF
# Chart Doc Gen
# renovate: datasource=github-releases depName=kubepack/chart-doc-gen
ARG CHART_DOC_GEN_VERSION=0.5.0
ENV CHART_DOC_GEN_URL=https://github.com/kubepack/chart-doc-gen/releases/download/v"${CHART_DOC_GEN_VERSION}"/chart-doc-gen-linux-amd64
RUN <<EOF
curl -LSsO "$CHART_DOC_GEN_URL"
mv chart-doc-gen-linux-amd64 /usr/local/bin/chart-doc-gen
chmod +x /usr/local/bin/chart-doc-gen
EOF
# Helm Docs
# renovate: datasource=github-releases depName=norwoodj/helm-docs
ARG HELM_DOCS_VERSION=1.14.2
ENV HELM_DOCS_URL=https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.tar.gz
RUN <<EOF
curl -LSs "$HELM_DOCS_URL" | tar xz
mv ./helm-docs /usr/local/bin/helm-docs
chmod +x /usr/local/bin/helm-docs
helm-docs --version
EOF
# Kubeval
# renovate: datasource=github-releases depName=instrumenta/kubeval
ARG KUBEVAL_VERSION=v0.16.1
ENV KUBEVAL_URL=https://github.com/instrumenta/kubeval/releases/download/${KUBEVAL_VERSION}/kubeval-linux-amd64.tar.gz
RUN <<EOF
curl -LSs "$KUBEVAL_URL" | tar xz
mv ./kubeval /usr/local/bin/kubeval
chmod +x /usr/local/bin/kubeval
kubeval --version
EOF
# Kubeconform
# renovate: datasource=github-releases depName=yannh/kubeconform
ARG KUBECONFORM_VERSION=0.6.7
ENV KUBECONFORM_URL=https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz
RUN <<EOF
curl -LSs "$KUBECONFORM_URL"| tar xz
mv ./kubeconform /usr/local/bin/kubeconform
chmod +x /usr/local/bin/kubeconform
kubeconform -h
EOF
# Kube Score
# renovate: datasource=github-releases depName=zegl/kube-score
ARG KUBE_SCORE_VERSION=1.19.0
ENV KUBE_SCORE_URL=https://github.com/zegl/kube-score/releases/download/v${KUBE_SCORE_VERSION}/kube-score_${KUBE_SCORE_VERSION}_linux_amd64
RUN <<EOF
curl -LSs "$KUBE_SCORE_URL" -o kube-score
mv kube-score /usr/local/bin/kube-score
chmod +x /usr/local/bin/kube-score
kube-score version
EOF
# Chart Testing
# renovate: datasource=github-releases depName=helm/chart-testing
ARG CT_VERSION=3.11.0
ENV CT_URL=https://github.com/helm/chart-testing/releases/download/v"${CT_VERSION}"/chart-testing_"${CT_VERSION}"_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$CT_URL" | tar xz
mv ./ct /usr/local/bin/ct
chmod +x /usr/local/bin/ct
ct version
EOF
# Fairwinds Polaris
# renovate: datasource=github-releases depName=FairwindsOps/polaris
ARG POLARIS_VERSION=9.6.0
ENV POLARIS_URL=https://github.com/FairwindsOps/polaris/releases/download/${POLARIS_VERSION}/polaris_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$POLARIS_URL" | tar xz
mv ./polaris /usr/local/bin/polaris
chmod +x /usr/local/bin/polaris
polaris version
EOF
# Fairwinds Pluto
# renovate: datasource=github-releases depName=FairwindsOps/pluto
ARG PLUTO_VERSION=5.20.3
ENV PLUTO_URL=https://github.com/FairwindsOps/pluto/releases/download/v${PLUTO_VERSION}/pluto_${PLUTO_VERSION}_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$PLUTO_URL" | tar xz
mv ./pluto /usr/local/bin/pluto
chmod +x /usr/local/bin/pluto
pluto version
EOF
# Stackrox Kube Linter
# renovate: datasource=github-releases depName=stackrox/kube-linter
ARG KUBE_LINTER_VERSION=v0.7.1
ENV KUBE_LINTER_URL=https://github.com/stackrox/kube-linter/releases/download/${KUBE_LINTER_VERSION}/kube-linter-linux.tar.gz
RUN <<EOF
curl -LSs "$KUBE_LINTER_URL" | tar xz
mv ./kube-linter /usr/local/bin/kube-linter
chmod +x /usr/local/bin/kube-linter
kube-linter version
EOF
# Conftest
# renovate: datasource=github-releases depName=open-policy-agent/conftest
ARG CONFTEST_VERSION=0.56.0
ENV CONFTEST_URL=https://github.com/open-policy-agent/conftest/releases/download/v${CONFTEST_VERSION}/conftest_${CONFTEST_VERSION}_Linux_x86_64.tar.gz
RUN <<EOF
curl -LSs "$CONFTEST_URL" | tar xz
mv ./conftest /usr/local/bin/conftest
chmod +x /usr/local/bin/conftest
conftest --version
EOF
# Kustomize
# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize
ARG KUSTOMIZE_VERSION=5.5.0
ENV KUSTOMIZE_URL=https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$KUSTOMIZE_URL" | tar xz
mv ./kustomize /usr/local/bin/kustomize
chmod +x /usr/local/bin/kustomize
kustomize version
EOF
# Nova
# renovate: datasource=github-releases depName=FairwindsOps/nova
ARG NOVA_VERSION=3.10.2
ENV NOVA_URL=https://github.com/FairwindsOps/nova/releases/download/v${NOVA_VERSION}/nova_${NOVA_VERSION}_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$NOVA_URL" | tar xz
mv ./nova /usr/local/bin/nova
chmod +x /usr/local/bin/nova
nova version
EOF
# Kubesec
# renovate: datasource=github-releases depName=controlplaneio/kubesec
ARG KUBESEC_VERSION=2.14.2
ENV KUBESEC_URL=https://github.com/controlplaneio/kubesec/releases/download/v${KUBESEC_VERSION}/kubesec_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$KUBESEC_URL" | tar xz
mv ./kubesec /usr/local/bin/kubesec
chmod +x /usr/local/bin/kubesec
kubesec version
EOF
# Kube No Trouble
# renovate: datasource=github-releases depName=doitintl/kube-no-trouble
ARG KUBENT_VERSION=0.7.3
ENV KUBENT_URL=https://github.com/doitintl/kube-no-trouble/releases/download/${KUBENT_VERSION}/kubent-${KUBENT_VERSION}-linux-amd64.tar.gz
RUN <<EOF
curl -LSs "$KUBENT_URL" | tar xz
mv ./kubent /usr/local/bin/kubent
chmod +x /usr/local/bin/kubent
EOF
# Trivy
# renovate: datasource=github-releases depName=aquasecurity/trivy
ARG TRIVY_VERSION=0.58.0
ENV TRIVY_URL=https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
RUN <<EOF
curl -LSs "$TRIVY_URL" | tar xz
mv ./trivy /usr/local/bin/trivy
chmod +x /usr/local/bin/trivy
trivy --version
EOF
# yq
# renovate: datasource=github-releases depName=mikefarah/yq
ARG YQ_VERSION=4.44.6
ENV YQ_URL=https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64
RUN <<EOF
curl -LSsO "$YQ_URL"
mv ./yq_linux_amd64 /usr/local/bin/yq
chmod +x /usr/local/bin/yq
yq --version
EOF
# kubescape
# renovate: datasource=github-releases depName=armosec/kubescape
ARG KUBESCAPE_VERSION=3.0.22
ENV KUBESCAPE_URL=https://github.com/armosec/kubescape/releases/download/v${KUBESCAPE_VERSION}/kubescape-ubuntu-latest
RUN <<EOF
curl -LSsO "$KUBESCAPE_URL"
mv ./kubescape-ubuntu-latest /usr/local/bin/kubescape
chmod +x /usr/local/bin/kubescape
kubescape version
kubescape download framework nsa
kubescape download framework mitre
EOF
# gomplate
# renovate: datasource=github-releases depName=hairyhenderson/gomplate
ARG GOMPLATE_VERSION=4.2.0
ENV GOMPLATE_URL=https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-amd64
RUN <<EOF
curl -LSsO "$GOMPLATE_URL"
mv ./gomplate_linux-amd64 /usr/local/bin/gomplate
chmod +x /usr/local/bin/gomplate
gomplate --version
EOF
# cosign
# renovate: datasource=github-releases depName=sigstore/cosign
ARG COSIGN_VERSION=2.4.1
ENV COSIGN_URL=https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64
RUN <<EOF
curl -LSsO "$COSIGN_URL"
mv ./cosign-linux-amd64 /usr/local/bin/cosign
chmod +x /usr/local/bin/cosign
cosign version
EOF
# crane
# renovate: datasource=github-releases depName=google/go-containerregistry
ARG CRANE_VERSION=0.20.2
ENV CRANE_URL=https://github.com/google/go-containerregistry/releases/download/v${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz
RUN <<EOF
curl -LSs "$CRANE_URL" | tar xz
mv ./crane /usr/local/bin/crane
chmod +x /usr/local/bin/crane
crane version
EOF
# kubepug
# renovate: datasource=github-releases depName=rikatz/kubepug
ARG KUBEPUG_VERSION=1.7.1
ENV KUBEPUG_URL=https://github.com/rikatz/kubepug/releases/download/v${KUBEPUG_VERSION}/kubepug_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$KUBEPUG_URL" | tar xz
mv ./kubepug /usr/local/bin/kubepug
chmod +x /usr/local/bin/kubepug
kubepug version
EOF
# container-structure-test
# renovate: datasource=github-releases depName=GoogleContainerTools/container-structure-test
ARG CONTAINER_STRUCTURE_TEST_VERSION=1.19.3
ENV CONTAINER_STRUCTURE_TEST_URL=https://github.com/GoogleContainerTools/container-structure-test/releases/download/v${CONTAINER_STRUCTURE_TEST_VERSION}/container-structure-test-linux-amd64
RUN <<EOF
curl -LSsO "$CONTAINER_STRUCTURE_TEST_URL"
mv container-structure-test-linux-amd64 container-structure-test
mv container-structure-test /usr/local/bin/
chmod +x /usr/local/bin/container-structure-test
container-structure-test version
EOF
# ah cli
# renovate: datasource=github-releases depName=artifacthub/hub
ARG AH_CLI_VERSION=1.20.0
ENV AH_CLI_URL=https://github.com/artifacthub/hub/releases/download/v${AH_CLI_VERSION}/ah_${AH_CLI_VERSION}_linux_amd64.tar.gz
RUN <<EOF
curl -LSs "$AH_CLI_URL" | tar xz
mv ./ah /usr/local/bin/ah
chmod +x /usr/local/bin/ah
ah version
EOF
# kyverno cli
# renovate: datasource=github-releases depName=kyverno/kyverno
ARG KYVERNO_CLI_VERSION=1.13.2
ENV KYVERNO_CLI_URL=https://github.com/kyverno/kyverno/releases/download/v${KYVERNO_CLI_VERSION}/kyverno-cli_v${KYVERNO_CLI_VERSION}_linux_x86_64.tar.gz
RUN <<EOF
curl -LSs "$KYVERNO_CLI_URL" | tar xz
mv ./kyverno /usr/local/bin/kyverno
chmod +x /usr/local/bin/kyverno
kyverno version
EOF
# s5cmd
# renovate: datasource=github-releases depName=peak/s5cmd
ARG S5CMD_VERSION=2.2.2
ENV S5CMD_CLI_URL=https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/s5cmd_${S5CMD_VERSION}_Linux-64bit.tar.gz
RUN <<EOF
curl -LSs "$S5CMD_CLI_URL" | tar xz
mv ./s5cmd /usr/local/bin/s5cmd
chmod +x /usr/local/bin/s5cmd
s5cmd version
EOF
COPY scripts/ /usr/local/bin
COPY opt/ /opt/kube-powertools/
RUN chmod +x /usr/local/bin/*.sh
# hadolint ignore=DL3002
USER 0:0
WORKDIR /root/workspace
CMD ["/bin/bash"]