Skip to content

Instantly share code, notes, and snippets.

@cruftyoldsysadmin
Created March 6, 2025 10:41
Show Gist options
  • Save cruftyoldsysadmin/c8cc066075edbe57d78579617dd3304a to your computer and use it in GitHub Desktop.
Save cruftyoldsysadmin/c8cc066075edbe57d78579617dd3304a to your computer and use it in GitHub Desktop.
Output of running docker-file lint on a non-existent file.
File: <contents>
Issues: 4
Line 1: Dockerfile
Issue Category Title Description
1 Possible Bug Missing Required All commands in a Dockerfile require at least 1 argument.
Arguments A line in a Dockerfile can be in any of the following formats:
* * *
#### `# Comment`
Docker will treat any line that begins with a `#` as a comment.
* * *
#### `INSTRUCTION arguments`
All instructions require at least 1 argument, and should be on the
same line as the `INSTRUCTION`.
* * *
#### `RUN` continuation
If a `RUN` line ends with a `\`, the next line will be treated as
part of the same `RUN` arguement.
* * *
#### Blank or Whitespace
Blank lines are allowed and will be ignored.
* * *
2 Clarity Capitalize For clarity and readability, all instructions in a Dockerfile
Dockerfile should be uppercase.
Instructions This is a convention adopted by most of the official images and
greatly improves readability in long Dockerfiles. For an example
of
why this makes a difference, check out the current [redis
Dockerfile](https://github.com/docker-library/redis/blob/b375650fb6
9b7db819e90c0033433c705b28656e/3.0/Dockerfile)
and you should be able to easily see the instructions used.
3 Possible Bug First Command Must The first instruction in a Dockerfile must specify the base image
Be FROM or ARG using a FROM command or an ARG command to modify the FROM command.
Additionally, FROM cannot appear later in a Dockerfile.
4 Possible Bug Invalid Line This line is not a valid Dockerfile line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment