From ef7ac6ec1ae2399dc0a3ed206af89130c8978b44 Mon Sep 17 00:00:00 2001 From: riya-singhal31 Date: Tue, 11 Jul 2023 23:47:32 +0530 Subject: [PATCH] fix: enable hadolint linter in super linter Signed-off-by: riya-singhal31 --- .github/workflows/lint-extras.yaml | 1 - Dockerfile | 2 +- build/Containerfile.sidecar | 4 +++- build/Containerfile.tools | 8 ++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-extras.yaml b/.github/workflows/lint-extras.yaml index 18249a7e9..db5c4722f 100644 --- a/.github/workflows/lint-extras.yaml +++ b/.github/workflows/lint-extras.yaml @@ -23,7 +23,6 @@ jobs: env: FILTER_REGEX_EXCLUDE: > (.*vendor/.*)|(.*tools/vendor/.*) - VALIDATE_DOCKERFILE_HADOLINT: false VALIDATE_GO: false VALIDATE_JSCPD: false VALIDATE_KUBERNETES_KUBECONFORM: false diff --git a/Dockerfile b/Dockerfile index 47059fd59..15f393963 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.20 as builder # Copy the contents of the repository -ADD . /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons +COPY . /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons ENV GOPATH=/workspace/go CGO_ENABLED=0 WORKDIR /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons diff --git a/build/Containerfile.sidecar b/build/Containerfile.sidecar index 10800272c..3c130d3ee 100644 --- a/build/Containerfile.sidecar +++ b/build/Containerfile.sidecar @@ -2,7 +2,7 @@ FROM golang:1.20 as builder # Copy the contents of the repository -ADD . /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons +COPY . /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons ENV GOPATH=/workspace/go CGO_ENABLED=0 WORKDIR /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons @@ -12,6 +12,8 @@ RUN make build # Use distroless as minimal base image to package the sidecar binary # Refer to https://github.com/GoogleContainerTools/distroless for more details +# DL3007 ignored as it asks to pin the version explicitly to a release tag +# hadolint ignore=DL3007 FROM gcr.io/distroless/static:latest WORKDIR / COPY --from=builder /workspace/go/src/github.com/csi-addons/kubernetes-csi-addons/bin/csi-addons-sidecar /usr/sbin/ diff --git a/build/Containerfile.tools b/build/Containerfile.tools index e6eeca1eb..0aaad4fda 100644 --- a/build/Containerfile.tools +++ b/build/Containerfile.tools @@ -1,8 +1,12 @@ +# DL3007 ignored as it asks to pin the version explicitly to a release tag +# hadolint ignore=DL3007 FROM quay.io/fedora/fedora:latest -ENV GOPATH=/go \ - PATH="${GOPATH}/bin:${PATH}" +ENV GOPATH=/go +ENV PATH="${GOPATH}/bin:${PATH}" +# DL3041 ignored as it asks to specify version with `dnf install -y - +# hadolint ignore=DL3041 RUN dnf -y install \ git \ make \