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
Run the following Cargo command in your project directory:
cargo install dockerfile-parser-rs
Example:
# prints the Dockerfile as JSON
dockerfile-parser-rs ./Dockerfile
Limitations
Instruction case sensitivity
The instructions are not case-sensitive. However, the library works only with uppercase instructions
for simplicity and consistency. Using uppercase instructions is also a recommended convention in
Dockerfile format documentation.
Instruction arguments ordering
Options for all instructions will be sorted in alphabetical order. This is done to ensure
deterministic output when dumping a Dockerfile. The same applies to the ARG, ENV, and LABEL
instructions when they have multiple key-value pairs defined on one line.
Here-documents (heredocs)
Here-documents allow redirection of subsequent Dockerfile lines to the input of RUN or COPY
commands. If such a command contains a here-document, the Dockerfile considers the next lines until
the line only containing a here-doc delimiter as part of the same command.
The here-documents syntax is only supported for the RUN instruction and only with the EOF
delimiter. Make sure that here-documents are always terminated with an EOF character on a new
line.