From 8c36305c6ae37c3cb6f1c551de575dea9ba4e0a5 Mon Sep 17 00:00:00 2001 From: Olivier Benz Date: Mon, 21 Jul 2025 20:18:52 +0200 Subject: [PATCH] Dev Containers: Install hadolint from official image --- .devcontainer/GHC.Dockerfile | 18 +++++------------- .hadolint.yaml | 5 +++++ 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 .hadolint.yaml diff --git a/.devcontainer/GHC.Dockerfile b/.devcontainer/GHC.Dockerfile index 5f987f2c80..bd54903bd5 100644 --- a/.devcontainer/GHC.Dockerfile +++ b/.devcontainer/GHC.Dockerfile @@ -27,6 +27,8 @@ FROM quay.io/benz0li/hlssi:${HLS_IMAGE_TAG} AS hlssi FROM quay.io/benz0li/hlsi:latest AS hlsi +FROM ghcr.io/hadolint/hadolint:latest as hsi + FROM docker.io/koalaman/shellcheck:stable AS sci FROM ${BUILD_ON_IMAGE}:${GHC_VERSION}${SUBTAG:+-}${SUBTAG} @@ -42,19 +44,7 @@ RUN sysArch="$(uname -m)" \ ## Install terminal multiplexers && apk add --no-cache screen tmux \ ## Install yamllint - && apk add --no-cache yamllint \ - ## Install hadolint - && case "$sysArch" in \ - x86_64) tarArch="x86_64" ;; \ - aarch64) tarArch="arm64" ;; \ - *) echo "error: Architecture $sysArch unsupported"; exit 1 ;; \ - esac \ - && apiResponse="$(curl -sSL \ - https://api.github.com/repos/hadolint/hadolint/releases/latest)" \ - && downloadUrl="$(echo "$apiResponse" | grep -e \ - "browser_download_url.*Linux-$tarArch\"" | cut -d : -f 2,3 | tr -d \")" \ - && echo "$downloadUrl" | xargs curl -sSLo /usr/local/bin/hadolint \ - && chmod 755 /usr/local/bin/hadolint + && apk add --no-cache yamllint ## Update environment ARG USE_ZSH_FOR_ROOT @@ -97,6 +87,8 @@ RUN if [ -n "$USE_ZSH_FOR_ROOT" ]; then \ COPY --from=hlssi /usr/local /usr/local ## Install HLint COPY --from=hlsi /usr/local /usr/local +## Install Haskell Dockerfile Linter +COPY --from=hsi /bin/hadolint /usr/local/bin ## Install ShellCheck COPY --from=sci --chown=root:root /bin/shellcheck /usr/local/bin diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000000..b9a05e4538 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,5 @@ +ignored: +- DL3003 +- DL3006 +- DL3007 +- DL3018