Documentation ¶
Index ¶
Constants ¶
View Source
const ( ComposeProjectName = "COMPOSE_PROJECT_NAME" ComposeFileSeparator = "COMPOSE_FILE_SEPARATOR" ComposeFilePath = "COMPOSE_FILE" )
Variables ¶
View Source
var DefaultFileNames = []string{"compose.yaml", "compose.yml", "docker-compose.yml", "docker-compose.yaml"}
DefaultFileNames defines the Compose file names for auto-discovery (in order of preference)
Functions ¶
func ProjectFromOptions ¶
func ProjectFromOptions(options *ProjectOptions) (*types.Project, error)
ProjectFromOptions load a compose project based on command line options
func WithDotEnv ¶
func WithDotEnv(o *ProjectOptions) error
WithDotEnv imports environment variables from .env file
func WithOsEnv ¶
func WithOsEnv(o *ProjectOptions) error
WithOsEnv imports environment variables from OS
Types ¶
type ProjectOptions ¶
type ProjectOptions struct { Name string WorkingDir string ConfigPaths []string Environment map[string]string }
ProjectOptions groups the command line options recommended for a Compose implementation
func NewProjectOptions ¶
func NewProjectOptions(configs []string, opts ...ProjectOptionsFn) (*ProjectOptions, error)
NewProjectOptions creates ProjectOptions
func (ProjectOptions) GetWorkingDir ¶
func (o ProjectOptions) GetWorkingDir() (string, error)
type ProjectOptionsFn ¶
type ProjectOptionsFn func(*ProjectOptions) error
func WithEnv ¶
func WithEnv(env []string) ProjectOptionsFn
WithEnv defines a key=value set of variables used for compose file interpolation
func WithWorkingDirectory ¶
func WithWorkingDirectory(wd string) ProjectOptionsFn
WithWorkingDirectory defines ProjectOptions' working directory
Click to show internal directories.
Click to hide internal directories.