An interface for Haskell Dockerfile Linter.
2.7K
A kgrv/mini:init image for hadolint interface.
| OS/ARCH | Description |
|---|---|
linux/amd64 | 64-bit x86 architecture for Linux operating systems |
linux/arm64 | 64-bit ARM architecture for Linux operating systems |
| Type | Container | Function |
|---|---|---|
| Volume | /mnt | Bind mount volume |
docker run --tty -v $(pwd):/mnt kgrv/hadolint --help
Usage: hadoint [-b <bin>] [-c <config>] [-n] [-q] [-s] [-d] [--trace] [--version] [--] [<dockerfiles...>]
An interface for Haskell Dockerfile Linter.
https://hub.docker.com/r/kgrv/hadolint
Positional Arguments:
dockerfiles list of Dockerfiles (scan on empty)
Options:
-b, --bin set Hadolint binary path
-c, --config set configuration file
-n, --no-fail exit code disregards rules violation
-q, --quiet quiet except WARN/ERROR
-s, --scan scan directories for Dockerfiles
-d, --debug enable debug mode
--trace enable trace mode (verbose)
--version display version
--help, help display usage information
docker run --tty -v $(pwd):/mnt kgrv/hadolint --config FILE DOCKERFILE
hadolint detects the following paths by default:
/mnt/.config/hadolint.yaml/mnt/.hadolint/hadolint.yaml/mnt/hadolint/config.yaml/mnt/.hadolint.yamlScan is the default mode when no Dockerfile is given, override the arguments by passing -s/--scan flag. The program will walk directories and find any Dockerfile match. It will then pass them to hadolint to be linted.
docker run --tty -v $(pwd):/mnt kgrv/hadolint
INFO hadoint > Scan for Dockerfiles
DEBUG hadoint > Dockerfiles: [
"/mnt/acso/Dockerfile",
"/mnt/alpine/Dockerfile",
"/mnt/code/Dockerfile",
...
Tip
Pass
-n/--no-failflag to disregard any rules violation, this allows non-disruptive integration.
hadoint will exit 2 for external errors, 1 for general errors, and 0 for success. The program prints out the code before exits, $? to capture the exit code.
Success:
INFO hadoint > Exit Code: 0
Failure:
ERROR hadoint > Exit Code: 1
-t/--ttydocker run --tty -v $(pwd):/mnt kgrv/hadolint DOCKERFILE 2>&1 | tee FILE
docker ... 2>&1 | sed 's/\x1b\[[0-9;]*[mGKHF]//g' | tee FILE
Running kgrv/hadolint on its source with .hadolint.yaml configured for our workflow:
INFO hadoint > Start Hadolint Interface
INFO hadoint > Scan for Dockerfiles
INFO hadoint > Run Hadolint
/mnt/Dockerfile:3 DL3006 info: Always tag the version of an image explicitly
/mnt/Dockerfile:19 DL3022 info: `COPY --from` should reference a previously defined `FROM` alias
/mnt/Dockerfile:24 DL3022 info: `COPY --from` should reference a previously defined `FROM` alias
/mnt/Dockerfile:35 DL3022 info: `COPY --from` should reference a previously defined `FROM` alias
INFO hadoint > Runtime 55.515ms
INFO hadoint > Exit Code: 0
INFO hadoint > Bye!
Content type
Image
Digest
sha256:77b8aaf36…
Size
14.1 MB
Last updated
about 1 month ago
docker pull kgrv/hadolint