From b59c6b43a70d48652d9658f7971e165ab9b753fd Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 6 Mar 2024 20:02:26 +0000 Subject: [PATCH] added hadolint bash script --- install-lint.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 install-lint.sh diff --git a/install-lint.sh b/install-lint.sh new file mode 100644 index 00000000..329388b1 --- /dev/null +++ b/install-lint.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Simple script to install and run Hadolint + echo "" + echo "#====================================================#" + echo "# Installing Hadolint" + echo "#====================================================#" + echo "" + + # Install Hadolint + wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 + # Move to appropriate directory + mv hadolint /usr/local/bin/hadolint + # Make file executable + chmod +x /usr/local/bin/hadolint + # Check hadolint version to make sure it is installed + hadolint -v + + echo "" + echo "#====================================================#" + echo "# Hadolint Installation Complete" + echo "#====================================================#" + echo "" + # Run Hadolint on Dockerfile + docker run --rm -i hadolint/hadolint < Dockerfile + + echo "" + echo "#====================================================#" + echo "# Dockerfile Linting Complete" + echo "#====================================================#" + echo ""