Skip to content

brendandburns/dotnet-dockerfile

Repository files navigation

dotnet core dockerfile parser

This is a simple set of classes for parsing and generating Dockerfiles

usage

generation

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());

parsing

var df = Dockerfile.Parse(new TextReader("Dockerfile"));
...

bugs

Probably. File issues.

nuget

dotnet add package Dockerfile --version 1.0.0

Dockerfile-1.0.0

About

Simple .NET core library for parsing and generating Dockerfiles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages