Skip to content

Commit

Permalink
added hadolint bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Mar 6, 2024
1 parent be3a5d7 commit b59c6b4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions install-lint.sh
Original file line number Diff line number Diff line change
@@ -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 ""

0 comments on commit b59c6b4

Please sign in to comment.