From fde7ac4bca2e2bd2ed7474ef2ede1cb4327b2750 Mon Sep 17 00:00:00 2001 From: Timo Riski Date: Thu, 21 Dec 2023 16:59:38 +0200 Subject: [PATCH] chore(lint): add and fix `hadolint` --- .trunk/configs/.hadolint.yaml | 4 ++++ .trunk/trunk.yaml | 1 + Dockerfile | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .trunk/configs/.hadolint.yaml diff --git a/.trunk/configs/.hadolint.yaml b/.trunk/configs/.hadolint.yaml new file mode 100644 index 000000000..98bf0cd2e --- /dev/null +++ b/.trunk/configs/.hadolint.yaml @@ -0,0 +1,4 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2a99601ec..356bcb823 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -11,6 +11,7 @@ plugins: lint: enabled: + - hadolint@2.12.0 - codespell@2.2.6 - actionlint@1.6.26 - git-diff-check diff --git a/Dockerfile b/Dockerfile index ba07bb035..0266463db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder WORKDIR /workspace # Copy the Go Modules manifests @@ -18,7 +18,7 @@ COPY controllers/ controllers/ ARG TARGETOS ARG TARGETARCH ARG VERSION=dev -RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath \ +RUN CGO_ENABLED=0 GOOS="$TARGETOS" GOARCH="$TARGETARCH" go build -trimpath \ -ldflags="-s -w -X github.com/aiven/aiven-operator/controllers.version=${VERSION}" \ -a -o manager main.go