$variable_name or $ literals respectively.Įxample (parsed representation is displayed after the #):ĮNV abc=hello ENV abc=bye def=$abc ENV ghi=$abc Escapes are also handled for including variable-like syntaxĮnvironment variables are notated in the Dockerfile either with Used in certain instructions as variables to be interpreted by theĭockerfile. Removing intermediate container a2c157f842f5Įnvironment variables (declared with the ENV statement) can also be 02:14 PM Program Files (x86 ) 11:18 AM 62 testfile.txt Removing intermediate container 4db9acbb1682 Sending build context to Docker daemon 3.072 kB PS E:\myproject> docker build -t succeeds -no-cache = true. Of this dockerfile is that second and third lines are considered a single Handled as an instruction, cause it be treated as a line continuation. Similarly, the \ at the end of the third line would, assuming it was actually The second \ at the end of the second line would be interpreted as anĮscape for the newline, instead of a target of the escape from the first \. ` is consistentĬonsider the following example which would fail in a non-obvious way on Windows, where \ is the directory path separator. Setting the escape character to ` is especially useful on Note that regardless of whether the escape parserĭirective is included in a Dockerfile, escaping is not performed inĪ RUN command, except at the end of a line. The escape character is used both to escape characters in a line, and toĮscape a newline. If not specified, the default escape character is \. The escape directive sets the character used to escape characters in aĭockerfile. Line continuation characters are not supported in parserĭue to these rules, the following examples are all invalid: Convention is also to include a blank line following any However, convention is for them toīe lowercase. Parser directives are not case-sensitive. Therefore, all parser directives must be at the very Instead it treats anything formattedĪs a parser directive as a comment and does not attempt to validate if it mightīe a parser directive. Once a comment, empty line or builder instruction has been processed, Docker Special type of comment in the form # directive=value. Parser directives do not add layers to the build,Īnd will not be shown as a build step. Parser directives are optional, and affect the way in which subsequent lines
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |