Skip to content

A structured model of Dockerfiles for parsing and generating

License

Notifications You must be signed in to change notification settings

mthalman/DockerfileModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerfile Model Library

This .NET library provides a structured model of the Dockerfile syntax for the purposes of parsing and generating Dockerfiles. It provides full fidelity of the file contents meaning that the parsed content can be output back to a string and produce the same content character-for-character, including whitespace. This makes it ideal for parsing as well as workflows that require programmatically modifying existing Dockerfiles.

Key Features

  • A high-level model for interacting with Dockerfile constructs.
  • Access to the underlying tokens that make up the higher-level model.
  • Full fidelity for input and output: the model's output is identical to the Dockerfile input.
  • Resolve ARG values that are referenced throughout a Dockerfile.
  • Ability to further organize a Dockerfile model in terms of its stages.

Usage

The library is available as a NuGet package: Valleysoft.DockerfileModel.

For code examples, check out the scenario tests which demonstrate how the API can be used for various scenarios.