File tree Expand file tree Collapse file tree 7 files changed +62
-1
lines changed Expand file tree Collapse file tree 7 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 17
17
# Build the manager binary
18
18
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
19
19
ARG builder_image
20
+
21
+ # Ignore Hadolint rule "Always tag the version of an image explicitly."
22
+ # It's an invalid finding since the image is explicitly set in the Makefile.
23
+ # https://github.com/hadolint/hadolint/wiki/DL3006
24
+ # hadolint ignore=DL3006
20
25
FROM ${builder_image} as builder
21
26
WORKDIR /workspace
22
27
Original file line number Diff line number Diff line change @@ -111,6 +111,9 @@ GO_APIDIFF_BIN := go-apidiff
111
111
GO_APIDIFF := $(abspath $(TOOLS_BIN_DIR ) /$(GO_APIDIFF_BIN ) -$(GO_APIDIFF_VER ) )
112
112
GO_APIDIFF_PKG := github.com/joelanford/go-apidiff
113
113
114
+ HADOLINT_VER := v2.10.0
115
+ HADOLINT_FAILURE_THRESHOLD = warning
116
+
114
117
KPROMO_VER := v3.4.4
115
118
KPROMO_BIN := kpromo
116
119
KPROMO := $(abspath $(TOOLS_BIN_DIR ) /$(KPROMO_BIN ) -$(KPROMO_VER ) )
@@ -446,6 +449,11 @@ lint: $(GOLANGCI_LINT) ## Lint the codebase
446
449
$(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
447
450
cd $(TEST_DIR ) ; $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
448
451
cd $(TOOLS_DIR ) ; $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
452
+ ./scripts/ci-lint-dockerfiles.sh $(HADOLINT_VER ) $(HADOLINT_FAILURE_THRESHOLD )
453
+
454
+ .PHONY : lint-dockerfiles
455
+ lint-dockerfiles :
456
+ ./scripts/ci-lint-dockerfiles.sh $(HADOLINT_VER ) $(HADOLINT_FAILURE_THRESHOLD )
449
457
450
458
.PHONY : lint-fix
451
459
lint-fix : $(GOLANGCI_LINT ) # # Lint the codebase and run auto-fixers if supported by the linter
Original file line number Diff line number Diff line change 17
17
# Build the clusterctl binary
18
18
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
19
19
ARG builder_image
20
+
21
+ # Ignore Hadolint rule "Always tag the version of an image explicitly."
22
+ # It's an invalid finding since the image is explicitly set in the Makefile.
23
+ # https://github.com/hadolint/hadolint/wiki/DL3006
24
+ # hadolint ignore=DL3006
20
25
FROM ${builder_image} as builder
21
26
WORKDIR /workspace
22
27
Original file line number Diff line number Diff line change 31
31
32
32
FROM maven:3-jdk-8
33
33
34
- RUN apt-get update && apt-get install -y --no-install-recommends graphviz fonts-symbola fonts-wqy-zenhei && rm -rf /var/lib/apt/lists/*
34
+ RUN apt-get update && apt-get install -y --no-install-recommends graphviz=2.42.2-5 fonts-symbola=2.60-1.1 fonts-wqy-zenhei=0.9.45-8 && rm -rf /var/lib/apt/lists/*
35
35
RUN wget -O /plantuml.jar http://sourceforge.net/projects/plantuml/files/plantuml.1.2019.6.jar/download
36
36
37
37
# By default, java writes a 'hsperfdata_<username>' directory in the work dir.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2022 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -o errexit
18
+ set -o nounset
19
+ set -o pipefail
20
+
21
+ HADOLINT_VER=${1:- latest}
22
+ HADOLINT_FAILURE_THRESHOLD=${2:- warning}
23
+
24
+ FILES=$( find -- * -name Dockerfile)
25
+ while read -r file; do
26
+ echo " Linting: ${file} "
27
+ # Configure the linter to fail for warnings and errors. Can be set to: error | warning | info | style | ignore | none
28
+ docker run --rm -i ghcr.io/hadolint/hadolint:" ${HADOLINT_VER} " hadolint --failure-threshold " ${HADOLINT_FAILURE_THRESHOLD} " - < " ${file} "
29
+ done <<< " ${FILES}"
Original file line number Diff line number Diff line change 17
17
# Build the extension binary
18
18
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
19
19
ARG builder_image
20
+
21
+ # Ignore Hadolint rule "Always tag the version of an image explicitly."
22
+ # It's an invalid finding since the image is explicitly set in the Makefile.
23
+ # https://github.com/hadolint/hadolint/wiki/DL3006
24
+ # hadolint ignore=DL3006
20
25
FROM ${builder_image} as builder
21
26
WORKDIR /workspace
22
27
Original file line number Diff line number Diff line change 16
16
17
17
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
18
18
ARG builder_image
19
+
20
+ # Ignore Hadolint rule "Always tag the version of an image explicitly."
21
+ # It's an invalid finding since the image is explicitly set in the Makefile.
22
+ # https://github.com/hadolint/hadolint/wiki/DL3006
23
+ # hadolint ignore=DL3006
19
24
FROM ${builder_image} as builder
20
25
21
26
# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy
@@ -58,6 +63,10 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
58
63
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -trimpath -a -o /workspace/manager main.go
59
64
60
65
# NOTE: CAPD can't use non-root because docker requires access to the docker socket
66
+
67
+ # Ignore Hadolint rule "Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag."
68
+ # https://github.com/hadolint/hadolint/wiki/DL3007
69
+ # hadolint ignore=DL3007
61
70
FROM gcr.io/distroless/static:latest
62
71
63
72
WORKDIR /
You can’t perform that action at this time.
0 commit comments