Dockerfile-Generator alternatives and similar packages
Based on the "DevOps Tools" category.
Alternatively, view Dockerfile-Generator alternatives based on common mentions on social networks and blogs.
-
Moby
Moby Project - a collaborative project for the container ecosystem to assemble container-based systems -
kubernetes
Production-Grade Container Scheduling and Management -
Gitea
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD -
Packer
Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. -
Flynn
[UNMAINTAINED] A next generation open source platform as a service (PaaS) -
webhook
webhook is a lightweight incoming webhook server to run shell commands -
kubeshark
The API traffic analyzer for Kubernetes providing real-time K8s protocol-level visibility, capturing and monitoring all traffic and payloads going in, out and across containers, pods, nodes and clusters. Inspired by Wireshark, purposely built for Kubernetes -
Ddosify
"Canva" of K8s Observability. Available on CLI, Self-Hosted, and Cloud - https://ddosify.com 🚀 -
Boom
HTTP(S) load generator, ApacheBench (ab) replacement, written in Go -
Mizu
The API traffic viewer for Kubernetes providing deep visibility into all API traffic and payloads going in, out and across containers and pods inside a Kubernetes cluster. Think TCPDump and Wireshark re-invented for Kubernetes [Moved to: https://github.com/kubeshark/kubeshark] -
bombardier
Fast cross-platform HTTP benchmarking tool written in Go -
dasel
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package. -
rtop
rtop is an interactive, remote system monitoring tool based on SSH -
goxc
a build tool for Go, with a focus on cross-compiling, packaging and deployment -
Fleet device management
Open-source platform for IT and security teams with thousands of computers. (Linux, macOS, Windows, Chromebooks, AWS, Google Cloud, Azure, data center, containers, IoT) -
StatusOK
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected. -
go-selfupdate
Enable your Go applications to self update -
s3gof3r
Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r -
uTask
µTask is an automation engine that models and executes business processes declared in yaml. ✏️📋 -
kwatch
:eyes: monitor & detect crashes in your Kubernetes(K8s) cluster instantly -
cassowary
:rocket: Modern cross-platform HTTP load-testing tool written in Go -
kool
From local development to the cloud: development workflow made easy. -
govvv
"go build" wrapper to add version info to Golang applications -
jcli
Jenkins CLI allows you to manage your Jenkins in an easy way. Jenkins 命令行客户端 -
Pewpew
Flexible HTTP command line stress tester for websites and web services -
easyssh-proxy
easyssh-proxy provides a simple implementation of some SSH protocol features in Go -
gonative
Build Go Toolchains /w native libs for cross-compilation
Updating dependencies is time-consuming.
Do you think we are missing an alternative of Dockerfile-Generator or a related project?
README
dfg - Dockerfile Generator
dfg
is both a go library and an executable that produces valid Dockerfiles using various input channels.
Table of Contents
Overview
dfg
is a Dockerfile generator that accepts input data from various sources, produces and redirects the generated Dockerfile to an output target such as a file or stdout.
It is especially useful for generating Dockerfile instructions conditionally since Dockerfile language has no control flow logic.
Installation
Installing as an Executable
- MacOS
curl -o dfg -L https://github.com/ozankasikci/dockerfile-generator/releases/download/v1.0.0/dfg_v1.0.0_darwin_amd64
chmod +x dfg && sudo mv dfg /usr/local/bin
- Linux
curl -o dfg -L https://github.com/ozankasikci/dockerfile-generator/releases/download/v1.0.0/dfg_v1.0.0_linux_amd64
chmod +x dfg && sudo mv dfg /usr/local/bin
- Windows
curl -o dfg.exe -L https://github.com/ozankasikci/dockerfile-generator/releases/download/v1.0.0/dfg_v1.0.0_windows_amd64.exe
Installing as a Library
go get -u github.com/ozankasikci/dockerfile-generator
Getting Started
Using dfg as an Executable
Available commands:
dfg generate --input path/to/yaml --out Dockerfile
generates a file named Dockerfile
dfg generate --input path/to/yaml --target-field ".server.dockerfile" --out Dockerfile
generates a file named Dockerfile
reading the .server.dockerfile
field of the YAML file.
dfg generate --help
lists available flags
Using dfg as a Library
When using dfg
as a go library, you need to pass a []dfg.Stage
slice as data.
This approach enables and encourages multi staged Dockerfiles.
Dockerfile instructions will be generated in the same order as in the []dfg.Instruction
slice.
Some Instruction
s accept a runForm
field which specifies if the Instruction
should be run in the shell form
or the exec form
.
If the runForm
is not specified, it will be chosen based on Dockerfile best practices.
For detailed usage example please see Library Usage Example
Examples
Single YAML File per Dockerfile Example (Expects a stages
key on top level)
stages:
final:
- from:
image: kstaken/apache2
- run:
runForm: shell
params:
- apt-get update &&
- apt-get install -y
- php5
- libapache2-mod-php5 &&
- apt-get clean &&
- rm -rf /var/lib/apt/lists/*
- cmd:
params:
- /usr/sbin/apache2
- -D
- FOREGROUND
Use dfg as binary:
dfg generate -i ./example-input-files/apache-php.yaml --stdout
Or as a library
data, err := dfg.NewDockerFileDataFromYamlFile("./example-input-files/apache-php.yaml")
tmpl := dfg.NewDockerfileTemplate(data)
err = tmpl.Render(output)
Output
FROM kstaken/apache2
RUN apt-get update && apt-get install -y php5 libapache2-mod-php5 && apt-get clean && rm -rf /var/lib/apt/lists/*
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
YAML File Example With Target Field (Allows using any field)
someConfig:
key: value
serverConfig:
dockerfile:
stages:
final:
- from:
image: kstaken/apache2
- run:
runForm: shell
params:
- apt-get update &&
- apt-get clean &&
- rm -rf /var/lib/apt/lists/*
Use dfg as binary:
dfg generate -i ./example-input-files/test-input-with-target-key-6.yaml --target-field ".serverConfig.dockerfile" --stdout
Or as a library
data, err := dfg.NewDockerFileDataFromYamlField("./example-input-files/test-input-with-target-key-6.yaml", ".serverConfig.dockerfile")
tmpl := dfg.NewDockerfileTemplate(data)
err = tmpl.Render(output)
Output
FROM kstaken/apache2
RUN apt-get update && apt-get clean && rm -rf /var/lib/apt/lists/*
Library Usage Example
package main
import dfg "github.com/ozankasikci/dockerfile-generator"
func main() {
data := &dfg.DockerfileData{
Stages: []dfg.Stage{
// Stage 1 - Builder Image
// An instruction is just an interface, so you can pass custom structs as well
[]dfg.Instruction{
dfg.From{
Image: "golang:1.7.3", As: "builder",
},
dfg.User{
User: "ozan",
},
dfg.Workdir{
Dir: "/go/src/github.com/ozankasikci/dockerfile-generator/",
},
dfg.RunCommand{
Params: []string{"go", "get", "-d", "-v", "golang.org/x/net/html"},
},
dfg.CopyCommand{
Sources: []string{"app.go"}, Destination: ".",
},
dfg.RunCommand{
Params: []string{"CGO_ENABLED=0", "GOOS=linux", "go", "build", "-a", "-installsuffix", "cgo", "-o", "app", "."},
},
},
// Stage 2 - Final Image
[]dfg.Instruction{
dfg.From{
Image: "alpine:latest", As: "final",
},
dfg.RunCommand{
Params: []string{"apk", "--no-cache", "add", "ca-certificates"},
},
dfg.User{
User: "root", Group: "admin",
},
dfg.Workdir{
Dir: "/root/",
},
dfg.CopyCommand{
From: "builder", Sources: []string{"/go/src/github.com/ozankasikci/dockerfile-generator/app"}, Destination: ".",
},
dfg.Cmd{
Params: []string{"./app"},
},
},
},
}
tmpl := dfg.NewDockerfileTemplate(data)
// write to a file
file, err := os.Create("Dockerfile")
err = tmpl.Render(file)
// or write to stdout
err = tmpl.Render(os.Stdout)
}
Output
FROM golang:1.7.3 as builder
USER ozan
WORKDIR /go/src/github.com/ozankasikci/dockerfile-generator/
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest as final
RUN apk --no-cache add ca-certificates
USER root:admin
WORKDIR /root/
COPY --from=builder /go/src/github.com/ozankasikci/dockerfile-generator/app .
CMD ["./app"]
TODO
- [x] Add reading Dockerfile data from an existing yaml file support
- [ ] Implement json file input channel
- [ ] Implement stdin input channel
- [ ] Implement toml file input channel