This is a simple set of classes for parsing and generating Dockerfiles
var instructions = new List<Instruction>();
instructions.Add(new Instruction("FROM", "debian:9"));
instructions.Add(new Instruction("RUN", " apt-get update && apt-get install libunwind8 libicu57"));
instructions.Add(new Instruction("COPY", string.Format("* /exe/", dir)));
instructions.Add(new Instruction("CMD", string.Format("/exe/{0} {1}", exe, getArgs(args))));
var df = new Dockerfile(instructions.ToArray(), new Comment[0]);
File.WriteAllText(dir + "/Dockerfile", df.Contents());
var df = Dockerfile.Parse(new TextReader("Dockerfile"));
...
Probably. File issues.
dotnet add package Dockerfile --version 1.0.0