Skip to content

Commit

Permalink
Merge pull request #11 from trussworks/adh-hadolint-arm64
Browse files Browse the repository at this point in the history
Fallback hadolint arm64 binary to x86_64
  • Loading branch information
ahobson authored Feb 3, 2022
2 parents 37522b5 + 4baaab1 commit b4323f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pre-commit-hadolint
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ HADOLINT_PREFIX_URL="https://github.com/hadolint/hadolint/releases/download"
HADOLINT_VERSION="v2.1.0"
OS=$(uname -s)
ARCH=$(uname -m)

# so far, hadolint is not providing arm64 binaries
if [[ "$ARCH" = "arm64" ]]; then
# fallback to x86 and hope for runtime translation on macOS
ARCH=x86_64
fi

HADOLINT_BINARY="hadolint-${OS}-${ARCH}"
HADOLINT_URL="${HADOLINT_PREFIX_URL}/${HADOLINT_VERSION}/${HADOLINT_BINARY}"


DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
LOCAL_BINARY="${DIR}/${HADOLINT_BINARY}-${HADOLINT_VERSION}"

Expand Down

0 comments on commit b4323f1

Please sign in to comment.