Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/garethr/dockerfilepp

Library for writing your own Dockerfile pre-processors
https://github.com/garethr/dockerfilepp

Last synced: 2 months ago
JSON representation

Library for writing your own Dockerfile pre-processors

Awesome Lists containing this project

README

        

A simple library for building Dockerfile pre-processors.

[![Build
Status](https://travis-ci.org/garethr/dockerfilepp.svg)](https://travis-ci.org/garethr/dockerfilepp)
[![Go Report
Card](https://goreportcard.com/badge/github.com/garethr/dockerfilepp)](https://goreportcard.com/report/github.com/garethr/dockerfilepp)
[![GoDoc](https://godoc.org/github.com/garethr/dockerfilepp?status.svg)](https://godoc.org/github.com/garethr/dockerfilepp)

Dockerfile pre-processors aim to make extending Dockerfile with new
domain-specific instructions easy. Simply build your own pre-processor
and pipe Dockerfiles in on stdin.

Here is a simple hello world usage of the API:

```go
package main

import (
"github.com/garethr/dockerfilepp"
)

func main() {
replacements := map[string]string{
"CUSTOM_INSTALL": "RUN apt-get install thing",
"CUSTOM_ECHO": "RUN echo hello",
}
dockerfilepp.Process(replacements, "include comprehensive help text here")
}
```

As a example implementation see [dockerfilepp-puppet](https://github.com/garethr/dockerfilepp-puppet)
which uses local files compiled into the binary rather than hard coded
variables.