Forrest logo
back to the hadolint tool

hadolint:tldr:d92c3

hadolint: Lint a Dockerfile, displaying the output in JSON format.
$ hadolint --format ${json} ${path-to-Dockerfile}
try on your machine

The command hadolint is a tool used to evaluate Dockerfiles for best practices and possible errors. It scans the Dockerfile and provides warnings or suggestions for improving its quality.

The specific command hadolint --format ${json} ${path-to-Dockerfile} executes the hadolint tool with additional options specified. Here is the breakdown:

  • hadolint: Refers to the hadolint command, indicating that you want to run this tool.
  • --format ${json}: Specifies the output format of the tool as JSON. The ${json} here isn't a command or literal value; it represents a variable or placeholder that could be replaced with the actual output format, e.g., --format json. This flag instructs hadolint to display the results in JSON format.
  • ${path-to-Dockerfile}: Refers to the path of the Dockerfile that you want to evaluate using hadolint. You would replace ${path-to-Dockerfile} with the actual file path, such as /path/to/my/Dockerfile.

Overall, this command runs hadolint with the specified options and provides feedback on the quality and best practices of the specified Dockerfile in JSON format.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hadolint tool