Skip to content

lrwx00t/gocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference

gocker

DSL-like Dockerfile using Go

Go Playground

Usage

After installing the package:

go get -u github.com/lrwx00t/gocker/generator

Simple main.go:

package main

import (
	. "github.com/lrwx00t/gocker/generator"
)

func main() {
	GenerateDockerfile([]Dockerfile{
		FROM("ubuntu"),
		CMD("This is a sample comment"),
		EXPOSE("8080"),
		EXPOSE("8081"),
		WORKDIR("/app"),
	})
}

Output:

❯ go run main.go
FROM ubuntu
CMD This is a sample comment
EXPOSE 8080
EXPOSE 8081
WORKDIR /app

About

DSL-like Dockerfile generation using Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages