You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: "Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.",
Detail: "Comment for ARG should follow the format: `# foo <description>`",
91
+
Level: 1,
92
+
Line: 3,
93
+
},
94
+
{
95
+
RuleName: "InvalidDefinitionDescription",
96
+
Description: "Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.",
Detail: "Comment for FROM should follow the format: `# base <description>`",
99
+
Level: 1,
100
+
Line: 5,
101
+
},
102
+
{
103
+
RuleName: "InvalidDefinitionDescription",
104
+
Description: "Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.",
Detail: "Comment for ARG should follow the format: `# version <description>`",
107
+
Level: 1,
108
+
Line: 7,
109
+
},
110
+
{
111
+
RuleName: "InvalidDefinitionDescription",
112
+
Description: "Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.",
<td>Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.</td>
description: Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.
Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.
12
+
```
13
+
14
+
## Description
15
+
16
+
The [`--call=outline`](https://docs.docker.com/reference/cli/docker/buildx/build/#call-outline)
17
+
and [`--call=targets`](https://docs.docker.com/reference/cli/docker/buildx/build/#call-outline)
18
+
flags for the `docker build` command print descriptions for build targets and arguments.
19
+
The descriptions are generated from [Dockerfile comments](https://docs.docker.com/reference/cli/docker/buildx/build/#descriptions)
20
+
that immediately precede the `FROM` or `ARG` instruction
21
+
and that begin with the name of the build stage or argument.
22
+
For example:
23
+
24
+
```dockerfile
25
+
# build-cli builds the CLI binary
26
+
FROM alpine AS build-cli
27
+
# VERSION controls the version of the program
28
+
ARG VERSION=1
29
+
```
30
+
31
+
In cases where preceding comments are not meant to be descriptions,
32
+
add an empty line or comment between the instruction and the preceding comment.
33
+
34
+
## Examples
35
+
36
+
❌ Bad: A non-descriptive comment on the line preceding the `FROM` command.
37
+
38
+
```dockerfile
39
+
# a non-descriptive comment
40
+
FROM scratch AS base
41
+
42
+
# another non-descriptive comment
43
+
ARG VERSION=1
44
+
```
45
+
46
+
✅ Good: An empty line separating non-descriptive comments.
47
+
48
+
```dockerfile
49
+
# a non-descriptive comment
50
+
51
+
FROM scratch AS base
52
+
53
+
# another non-descriptive comment
54
+
55
+
ARG VERSION=1
56
+
```
57
+
58
+
✅ Good: Comments describing `ARG` keys and stages immediately proceeding the command.
0 commit comments