From 0134ffcfc07f3bc377f48fad457df4b7290472b4 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 6 Oct 2020 22:31:53 +0800 Subject: [PATCH 1/4] Simplify shfmt install by using prebuilt binary --- Dockerfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f7e8eae..67ecffee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ FROM golangci/golangci-lint:v1.31.0 as golangci-lint FROM yoheimuta/protolint:v0.26.0 as protolint FROM koalaman/shellcheck:v0.7.1 as shellcheck FROM wata727/tflint:0.20.2 as tflint +FROM mvdan/shfmt:v3.1.2 as shfmt FROM accurics/terrascan:d182f1c as terrascan FROM hadolint/hadolint:latest-alpine as dockerfile-lint FROM ghcr.io/assignuser/lintr-lib:0.1.2 as lintr-lib @@ -313,14 +314,7 @@ COPY --from=kubeval /kubeval /usr/bin/ ################# # Install shfmt # ################# -ENV GO111MODULE=on \ - GOROOT=/usr/lib/go \ - GOPATH=/go - -ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin - -RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin -RUN go get mvdan.cc/sh/v3/cmd/shfmt +COPY --from=shfmt /bin/shfmt /usr/bin/ ############################# # Copy scripts to container # From 2bec091dbb72b47b24a30d94d66ca3a15a835d96 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:05:32 -0500 Subject: [PATCH 2/4] adding rules --- .github/linters/.hadolint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/linters/.hadolint.yml b/.github/linters/.hadolint.yml index b408c6b2..4ae5ed33 100644 --- a/.github/linters/.hadolint.yml +++ b/.github/linters/.hadolint.yml @@ -3,3 +3,6 @@ ## Hadolint config file ## ########################## ignored: + - DL4001 # Ignore wget and curl in same file + - DL4006 # ignore pipefail as we dont want to add layers + - DL3018 # We do pin version in pipfile.lock From 08c1113afc4227e8dd84d45fa767832cff62ce53 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:11:26 -0500 Subject: [PATCH 3/4] fix it --- .github/linters/.hadolint.yml | 2 ++ Dockerfile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/linters/.hadolint.yml b/.github/linters/.hadolint.yml index 4ae5ed33..a53249c7 100644 --- a/.github/linters/.hadolint.yml +++ b/.github/linters/.hadolint.yml @@ -6,3 +6,5 @@ ignored: - DL4001 # Ignore wget and curl in same file - DL4006 # ignore pipefail as we dont want to add layers - DL3018 # We do pin version in pipfile.lock + - DL3003 # Ignore workdir so we dont add layers + - SC2016 # ignore as its intepreted later diff --git a/Dockerfile b/Dockerfile index 089580af..5e0b945e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -273,7 +273,7 @@ RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checksty | grep browser_download_url \ | grep ".jar" \ | cut -d '"' -f 4) \ - && curl --retry 5 --retry-delay 5 -sSL $CHECKSTYLE_LATEST \ + && curl --retry 5 --retry-delay 5 -sSL "$CHECKSTYLE_LATEST" \ --output /usr/bin/checkstyle #################### From 68d629d461a88173761b2b655140fa8faeeb8c8d Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:14:31 -0500 Subject: [PATCH 4/4] fix pip --- .github/linters/.hadolint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/linters/.hadolint.yml b/.github/linters/.hadolint.yml index a53249c7..46f69af4 100644 --- a/.github/linters/.hadolint.yml +++ b/.github/linters/.hadolint.yml @@ -6,5 +6,6 @@ ignored: - DL4001 # Ignore wget and curl in same file - DL4006 # ignore pipefail as we dont want to add layers - DL3018 # We do pin version in pipfile.lock + - DL3013 # We do pin version in pipfile.lock - DL3003 # Ignore workdir so we dont add layers - SC2016 # ignore as its intepreted later