dockerfilepp

Library for writing your own Dockerfile pre-processors

APACHE-2.0 License

Stars
8

A simple library for building Dockerfile pre-processors.

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:

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 which uses local files compiled into the binary rather than hard coded variables.