Documentation
¶
Index ¶
Constants ¶
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 ¶
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.