dockerfile

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dockerfile generates a Dockerfile for a service that doesn't have one, from the language, build and start commands in its spec.

Output is deterministic and deliberately plain, so users can read it, copy it into their repo and take over from there.

Index

Constants

View Source
const (
	// Filename is the generated Dockerfile's name inside the build context.
	Filename = "Dockerfile.anyship"
	// IgnoreFilename is the per-Dockerfile ignore file BuildKit reads for Filename.
	// It takes precedence over .dockerignore, so it includes that file's rules.
	IgnoreFilename = Filename + ".dockerignore"
	// StaticPort is the port generated static-site images serve on.
	StaticPort = 80
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Dockerfile []byte
	Ignore     []byte
}

Result holds the generated files, to be placed at the root of the build context.

func Generate

func Generate(svc *spec.Service, contextDir string) (*Result, error)

Generate writes a Dockerfile for svc. contextDir is the service's source directory; it is read (lockfiles, manifests) but never modified.

type UnsupportedError

type UnsupportedError struct{ Reason string }

UnsupportedError explains why no Dockerfile could be generated.

func (*UnsupportedError) Error

func (e *UnsupportedError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL