compose

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package compose loads Docker Compose files into a fully-resolved project model. It wraps the official compose-spec/compose-go reference loader (the same library Docker Compose itself uses) so that fruitbox parses, validates, interpolates, merges and normalizes compose files identically to `docker compose`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(ctx context.Context, opts LoadOptions) (*types.Project, error)

Load resolves a compose project from the given options, returning the canonical compose-go project model with services, networks, volumes, configs and secrets fully resolved.

Types

type LoadOptions

type LoadOptions struct {
	// ConfigPaths are the compose files to load, in order. When empty, the
	// loader discovers the default files (compose.yaml, docker-compose.yml, …)
	// starting from WorkingDir.
	ConfigPaths []string
	// WorkingDir is the project working directory. When empty it defaults to
	// the directory of the first config file (or the process cwd).
	WorkingDir string
	// ProjectName overrides the project name. When empty the name is derived
	// from the working directory (or COMPOSE_PROJECT_NAME).
	ProjectName string
	// Profiles enables the named compose profiles.
	Profiles []string
	// EnvFiles are additional .env files to load before OS environment.
	EnvFiles []string

	// NoInterpolate disables ${VAR} interpolation (--no-interpolate).
	NoInterpolate bool
	// NoNormalize disables model normalization (--no-normalize).
	NoNormalize bool
	// NoConsistency skips the consistency check (--no-consistency).
	NoConsistency bool
	// NoResolvePaths leaves relative paths unresolved (--no-path-resolution).
	NoResolvePaths bool
	// NoEnvResolution skips computing service environments (--no-env-resolution).
	NoEnvResolution bool
}

LoadOptions configures how a compose project is loaded. It mirrors the inputs `docker compose` accepts on the command line.

Jump to

Keyboard shortcuts

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