hadolint
Supported Version | Language | Website |
---|---|---|
1.22.1 | Dockerfile | https://github.com/hadolint/hadolint |
hadolint is a Dockerfile linter that helps you build best practice Docker images.
Getting Started
To start using hadolint, enable it in your repository settings.
For more details for hadolint, see the command-line help:
$ hadolint --help
Configuration
Here is a configuration example via sider.yml
:
linter:
hadolint:
target: "src/Dockerfile"
ignore: "DL3003"
trusted-registry: "my-company.com:500"
config: custom-hadolint.yml
You can use the following options to fine-tune hadolint to your project.
Name | Type | Default |
---|---|---|
root_dir | string | - |
target | string , string[] | **/Dockerfile{,.*} |
ignore | string , string[] | - |
trusted-registry | string , string[] | - |
config | string | - |
target
This option allows you to specify files or directories to analyze. If you specify some targets, configure as follow:
linter:
hadolint:
target:
- "backend/Dockerfile"
- "images/**/Dockerfile"
ignore
This option allows you to ignore some rules from result of analysis. You can specify rules as follow:
linter:
hadolint:
ignore:
- "DL3002"
- "DL3003"
See also the --ignore
option.
trusted-registry
This option can warn you when images from untrusted repositories are being used in Dockerfiles. If you specify some trusted repositories, configure as follow:
linter:
hadolint:
trusted-registry:
- "my-company.com:500"
See also the --trusted-registry
option.
config
This option allow you to specify configuration file in yaml format like this example. If you specify path to configuration file, configure as follow:
linter:
hadolint:
config: custom-hadolint.yml
See also the --config
option.