diff --git a/.github/workflows/dockerfile.yml b/.github/workflows/dockerfile.yml index f0551eb..02c8188 100644 --- a/.github/workflows/dockerfile.yml +++ b/.github/workflows/dockerfile.yml @@ -12,13 +12,19 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: docker://hadolint/hadolint:latest - uses: actions/checkout@v2 # - name: Installing dependencies.. - # run: if ! apt list --installed | grep -qP "^hadolint -"; then apt install -y hadolint; fi + # run: | + # # Fix untill hadolint it available by downstream + # if ! apt-cache search hadolint | grep -qP "^hadolint -"; then + # # Install hadolint if not already installed through apt + # if ! apt list --installed | grep -qP "^hadolint -"; then + # if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi + # fi + # fi - name: Linting.. run: | cd "$GITHUB_WORKSPACE" && for file in $(git ls-tree --name-only -r ${{ github.sha }} | grep '\.Dockerfile$'); do printf 'checking dockerfile %s using hadolint\n' "$file" - hadolint "$file" + docker run hadolint:latest hadolint "$file" done \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml index 2e8ccfc..a7118e7 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -11,4 +11,5 @@ vscode: - serayuzgur.crates@0.4.7:HMkoguLcXp9M3ud7ac3eIw== - timonwong.shellcheck@0.9.0:hsU/Rd39aqPYowTqL+DbXg== - krosf.vscode-valgrind@0.0.1:YTn5lOY8OnPKJYDqJPr/Sg== - - matklad.rust-analyzer@0.1.20200217:zozmBmOg1N91pRISIsYXBg== \ No newline at end of file + - matklad.rust-analyzer@0.1.20200217:zozmBmOg1N91pRISIsYXBg== + - exiasr.hadolint@0.3.0:/FkAW3eTb+z9O7VZAyAa0w== \ No newline at end of file diff --git a/gitpod/debian.Dockerfile b/gitpod/debian.Dockerfile index 50d3b0f..2ba1deb 100644 --- a/gitpod/debian.Dockerfile +++ b/gitpod/debian.Dockerfile @@ -1,6 +1,8 @@ FROM debian:latest # FIXME: Outputs `gitpod@ws-ce281d58-997b-44b8-9107-3f2da7feede3:/workspace/gitpod-tests1$` in terminal +# FIXME: Add hadolint executable + # To avoid bricked workspaces (https://github.com/gitpod-io/gitpod/issues/1171) ARG DEBIAN_FRONTEND=noninteractive @@ -25,7 +27,9 @@ RUN useradd \ RUN apt update \ && apt upgrade -y \ && apt dist-upgrade -y \ - && apt install -y rustc \ + && apt install -y rustc cargo \ + && : "Install hadolint if not available in downstream" \ + && if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi \ && apt autoremove -y \ && rm -rf /var/lib/apt/lists/* diff --git a/gitpod/gitpod.Dockerfile b/gitpod/gitpod.Dockerfile index f56b209..276d701 100644 --- a/gitpod/gitpod.Dockerfile +++ b/gitpod/gitpod.Dockerfile @@ -1,5 +1,7 @@ FROM gitpod/workspace-full-vnc:latest +# FIXME: Add hadolint executable + # To avoid bricked workspaces (https://github.com/gitpod-io/gitpod/issues/1171) ARG DEBIAN_FRONTEND=noninteractive @@ -13,6 +15,8 @@ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && apt-get upgrade -y \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \ && apt dist-upgrade -y \ + && : "Install hadolint if not available in downstream" \ + && if ! apt-cache search hadolint | grep -qP "^hadolint -.*"; then { if command -v wget >/dev/null; then apt install -y wget; fi ;} && wget https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-Linux-x86_64 -O /usr/bin/hadolint && { [ ! -x hadolint ] && chmod +x /usr/bin/hadolint ;}; elif apt-cache search hadolint | grep -qP "^hadolint -.*"; then apt install -y hadolint; fi \ && apt-get install -y clang valgrind shellcheck docker-ce docker-ce-cli containerd.io firefox tree xclip umbrello gnuplot fish zsh dia \ && rm -rf /var/lib/apt/lists/* \ && apt autoremove -y