Files
tldr/pages.zh/common/hadolint.md

24 lines
770 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# hadolint
> Dockerfile 代码检查工具。
> 更多信息请访问: <https://github.com/hadolint/hadolint>。
- 检查一个 Dockerfile
`hadolint {{path/to/Dockerfile}}`
- 检查一个 Dockerfile并以 JSON 格式显示输出:
`hadolint --format {{json}} {{path/to/Dockerfile}}`
- 检查一个 Dockerfile并以特定格式显示输出
`hadolint --format {{tty|json|checkstyle|codeclimate|codacy}} {{path/to/Dockerfile}}`
- 检查一个 Dockerfile忽略特定规则
`hadolint --ignore {{DL3006}} --ignore {{DL3008}} {{path/to/Dockerfile}}`
- 使用特定的受信任注册表检查多个 Dockerfile
`hadolint --trusted-registry {{docker.io}} --trusted-registry {{example.com}}:{{5000}} {{path/to/Dockerfile1 path/to/Dockerfile2 ...}}`