Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Hadolint (Latest Release)
#!/usr/bin/env sh
## URL for the latest release:
_latest="https://api.github.com/repos/hadolint/hadolint/releases/latest"
## Kernel name:
_kernel="$(uname -s)"
## Architecture:
_arch="$(uname -m)"
## Target:
_target="${1:-/usr/local/bin/hadolint}"
## Download the binary to target path:
curl -s "${_latest}" | \
grep browser_download_url | \
grep "${_kernel}-${_arch}" | \
cut -f 2- -d ":" | \
tr -d "\"" | \
wget -qi - -O "${_target}"
## Attend permissions:
chmod +x "${_target}"
@vst

This comment has been minimized.

Copy link
Owner Author

@vst vst commented Apr 21, 2021

Install to the default target path (/usr/local/bin/hadolint):

curl -sf -L https://gist.githubusercontent.com/vst/90e849a1d2249d4a713b98dcc53db637/raw/install-hadolint.sh | sudo sh

Install to custom target path:

curl -sf -L https://gist.githubusercontent.com/vst/90e849a1d2249d4a713b98dcc53db637/raw/install-hadolint.sh | sudo sh -s /tmp/hadolint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment