@@ -146,7 +146,7 @@ builds [refer to the documentation in the BuildKit repository](https://github.co
146146
147147Here is the format of the ` Dockerfile ` :
148148
149- ``` Dockerfile
149+ ``` dockerfile
150150# Comment
151151INSTRUCTION arguments
152152```
@@ -167,7 +167,7 @@ Docker treats lines that *begin* with `#` as a comment, unless the line is
167167a valid [ parser directive] ( #parser-directives ) . A ` # ` marker anywhere
168168else in a line is treated as an argument. This allows statements like:
169169
170- ``` Dockerfile
170+ ``` dockerfile
171171# Comment
172172RUN echo 'we are running some # of cool things'
173173```
@@ -197,14 +197,14 @@ Due to these rules, the following examples are all invalid:
197197
198198Invalid due to line continuation:
199199
200- ``` Dockerfile
200+ ``` dockerfile
201201# direc \
202202tive=value
203203```
204204
205205Invalid due to appearing twice:
206206
207- ``` Dockerfile
207+ ``` dockerfile
208208# directive=value1
209209# directive=value2
210210
@@ -213,15 +213,15 @@ FROM ImageName
213213
214214Treated as a comment due to appearing after a builder instruction:
215215
216- ``` Dockerfile
216+ ``` dockerfile
217217FROM ImageName
218218# directive=value
219219```
220220
221221Treated as a comment due to appearing after a comment which is not a parser
222222directive:
223223
224- ``` Dockerfile
224+ ``` dockerfile
225225# About my dockerfile
226226# directive=value
227227FROM ImageName
@@ -231,15 +231,15 @@ The unknown directive is treated as a comment due to not being recognized. In
231231addition, the known directive is treated as a comment due to appearing after
232232a comment which is not a parser directive.
233233
234- ``` Dockerfile
234+ ``` dockerfile
235235# unknowndirective=value
236236# knowndirective=value
237237```
238238
239239Non line-breaking whitespace is permitted in a parser directive. Hence, the
240240following lines are all treated identically:
241241
242- ``` Dockerfile
242+ ``` dockerfile
243243# directive=value
244244# directive =value
245245# directive= value
@@ -334,7 +334,7 @@ handled as an instruction, cause it be treated as a line continuation. The resul
334334of this dockerfile is that second and third lines are considered a single
335335instruction:
336336
337- ``` Dockerfile
337+ ``` dockerfile
338338FROM microsoft/nanoserver
339339COPY testfile.txt c:\\
340340RUN dir c:\
@@ -602,7 +602,7 @@ and use it to cross-compile to the target platform inside the stage.
602602` FROM ` instructions support variables that are declared by any ` ARG `
603603instructions that occur before the first ` FROM ` .
604604
605- ``` Dockerfile
605+ ``` dockerfile
606606ARG CODE_VERSION=latest
607607FROM base:${CODE_VERSION}
608608CMD /code/run-app
@@ -616,7 +616,7 @@ can't be used in any instruction after a `FROM`. To use the default value of
616616an ` ARG ` declared before the first ` FROM ` use an ` ARG ` instruction without
617617a value inside of a build stage:
618618
619- ``` Dockerfile
619+ ``` dockerfile
620620ARG VERSION=latest
621621FROM busybox:$VERSION
622622ARG VERSION
@@ -851,13 +851,13 @@ ports and map them to high-order ports.
851851
852852By default, ` EXPOSE ` assumes TCP. You can also specify UDP:
853853
854- ``` Dockerfile
854+ ``` dockerfile
855855EXPOSE 80/udp
856856```
857857
858858To expose on both TCP and UDP, include two lines:
859859
860- ``` Dockerfile
860+ ``` dockerfile
861861EXPOSE 80/tcp
862862EXPOSE 80/udp
863863```
@@ -1491,7 +1491,7 @@ group (or GID) to use when running the image and for any `RUN`, `CMD` and
14911491> On Windows, the user must be created first if it's not a built-in account.
14921492> This can be done with the ` net user ` command called as part of a Dockerfile.
14931493
1494- ``` Dockerfile
1494+ ``` dockerfile
14951495 FROM microsoft/windowsservercore
14961496 # Create Windows user in the container
14971497 RUN net user /add patrick
@@ -1735,7 +1735,7 @@ these arguments inside the build stage redefine it without value.
17351735
17361736For example:
17371737
1738- ``` Dockerfile
1738+ ``` dockerfile
17391739FROM alpine
17401740ARG TARGETPLATFORM
17411741RUN echo "I'm building for $TARGETPLATFORM"
0 commit comments