dockerfile_lint
dockerfile_lint copied to clipboard
Color code the output
Feature request:
In order to make the error more obvious, it would be nice to color them in red in the output. Like shellcheck does:
Then as a user, it's quicker to see a problem.
version:
hadolint --version Haskell Dockerfile Linter 1.11.0-no-git
Nothing that a good old Python wrapper can't fix:
https://github.com/mperezi/spring-tasks-app/blob/dockerfile-best-practices/scripts/hadolint.py
Usage:
$ python hadolint.py Dockerfile # uses the hadolint binary
$ python hadolint.py --docker Dockerfile # uses the dockerized version of hadolint
Expected output (console):
Expected output (pipe or file):
FROM openjdk:8
[x] DL3020: Use COPY instead of ADD for files and folders
ADD build/libs/spring-tasks-app-*.jar /app.jar
[!] DL3025: Use arguments JSON notation for CMD and ENTRYPOINT arguments
ENTRYPOINT java -jar /app.jar
You can always enforce no colors with:
$ python hadolint.py --color=never Dockerfile