Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brendandburns/dotnet-dockerfile
Simple .NET core library for parsing and generating Dockerfiles
https://github.com/brendandburns/dotnet-dockerfile
Last synced: about 2 months ago
JSON representation
Simple .NET core library for parsing and generating Dockerfiles
- Host: GitHub
- URL: https://github.com/brendandburns/dotnet-dockerfile
- Owner: brendandburns
- License: mit
- Created: 2017-08-30T21:31:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-03T06:14:42.000Z (over 7 years ago)
- Last Synced: 2024-11-09T03:58:19.517Z (2 months ago)
- Language: C#
- Size: 3.91 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# dotnet core dockerfile parser
This is a simple set of classes for parsing and generating Dockerfiles
# usage
## generation
```csharp
var instructions = new List();
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
```csharp
var df = Dockerfile.Parse(new TextReader("Dockerfile"));
...
```# bugs
Probably. [File issues.](https://github.com/brendandburns/dotnet-dockerfile/issues)# nuget
```sh
dotnet add package Dockerfile --version 1.0.0
```[Dockerfile-1.0.0](https://www.nuget.org/packages/Dockerfile/1.0.0)