Debian Codegraph @

buildkit/frontend/dockerfile/linter/docs/NoEmptyContinuation.md

raw
1 ## Output
2
3 ```text
4 Empty continuation line found in: RUN apk add gnupg curl
5 ```
6
7 ## Description
8
9 Support for empty continuation (`/`) lines have been deprecated and will
10 generate errors in future versions of the Dockerfile syntax.
11
12 Empty continuation lines are empty lines following a newline escape:
13
14 ```dockerfile
15 FROM alpine
16 RUN apk add \
17
18 gnupg \
19
20 curl
21 ```
22
23 Support for such empty lines is deprecated, and a future BuildKit release will
24 remove support for this syntax entirely, causing builds to break. To avoid
25 future errors, remove the empty lines, or add comments, since lines with
26 comments aren't considered empty.
27
28 ## Examples
29
30 ❌ Bad: empty continuation line between `EXPOSE` and 80.
31
32 ```dockerfile
33 FROM alpine
34 EXPOSE \
35
36 80
37 ```
38
39 ✅ Good: comments do not count as empty lines.
40
41 ```dockerfile
42 FROM alpine
43 EXPOSE \
44 # Port
45 80
46 ```