docker

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 4 Imported by: ? modules, 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

Index

Constants

View Source
const SSHSecretID = "godev_ssh_key" //nolint:gosec // G101: the id of the secret, not a credential

SSHSecretID is the BuildKit secret holding the private key used to download private modules. It is mounted for the download layer only, so it never reaches an image or the build metadata, unlike a --build-arg.

Variables

This section is empty.

Functions

func DetectPrivateModulePrefix added in v0.6.0

func DetectPrivateModulePrefix() string

DetectPrivateModulePrefix returns the "host/owner" prefix of the module declared in go.mod, which is where a project's own private modules live. It returns an empty string when go.mod is missing or its module path is not a repository path, as in "module myapp".

func GenerateUniversalDockerfile

func GenerateUniversalDockerfile(opts Options) string

GenerateUniversalDockerfile produces a standardized, hardened multi-stage Dockerfile for any Go microservice by scanning the cmd/ directory for entrypoints.

Types

type Options added in v0.6.0

type Options struct {
	// PrivateModulePrefix is the "host/owner" prefix of the private Go modules
	// the project depends on, such as "github.com/acme". The builder stage
	// exports it through GOPRIVATE and fetches those modules over SSH with the
	// key mounted as the SSHSecretID build secret. When it is empty, the build
	// only uses public modules and no key is needed.
	PrivateModulePrefix string
}

Options controls how the universal Dockerfile is generated.

Jump to

Keyboard shortcuts

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