From 6006ae7e52f8ce3baadd33fee5f5748b768d5aab Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 29 Nov 2018 01:19:18 +0100 Subject: [PATCH] Use official shellcheck image This patch switches the shellcheck image to use the official image from Docker Hub. Note that this does not yet update shellcheck to the latest version (v0.5.x); Shellcheck v0.4.7 added some new checks, which makes CI currently fail, so will be done in a follow-up PR. Instead, the v0.4.6 version is used in this PR, which is closest to the same version as was installed in the image before this change; ``` docker run --rm docker-cli-shell-validate shellcheck --version ShellCheck - shell script analysis tool version: 0.4.4 license: GNU General Public License, version 3 website: http://www.shellcheck.net ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 388646eab0259c7e7410fe51679d6e4191cd8ab4) Signed-off-by: Sebastiaan van Stijn Upstream-commit: b59752479b72f8b6c7367f48d51e81ba8fef0024 Component: cli --- components/cli/dockerfiles/Dockerfile.shellcheck | 11 ++++------- components/cli/scripts/warn-outside-container | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/cli/dockerfiles/Dockerfile.shellcheck b/components/cli/dockerfiles/Dockerfile.shellcheck index 4d0ddd3332..2507062ee9 100644 --- a/components/cli/dockerfiles/Dockerfile.shellcheck +++ b/components/cli/dockerfiles/Dockerfile.shellcheck @@ -1,10 +1,7 @@ -FROM debian:stretch-slim - -RUN apt-get update && \ - apt-get -y install make shellcheck && \ - apt-get clean - +FROM koalaman/shellcheck-alpine:v0.4.6 +RUN apk add --no-cache bash make WORKDIR /go/src/github.com/docker/cli ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 -CMD bash +ENTRYPOINT [""] +CMD ["/bin/sh"] COPY . . diff --git a/components/cli/scripts/warn-outside-container b/components/cli/scripts/warn-outside-container index e937caafeb..ecbecc0ea2 100755 --- a/components/cli/scripts/warn-outside-container +++ b/components/cli/scripts/warn-outside-container @@ -1,9 +1,9 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -eu target="${1:-}" -if [[ "$target" != "help" && -z "${DISABLE_WARN_OUTSIDE_CONTAINER:-}" ]]; then +if [ "$target" != "help" ] && [ -z "${DISABLE_WARN_OUTSIDE_CONTAINER:-}" ]; then ( echo echo