composeimage

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package composeimage rewrites a Compose file for artifacts deploy (build → image).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateForArtifacts

func GenerateForArtifacts(composeYAML []byte, o Options) ([]byte, error)

GenerateForArtifacts reads a Compose YAML document and produces a variant where built services use image: instead of build:.

func ServiceBuildDirs added in v1.1.0

func ServiceBuildDirs(composeYAML []byte, projectRoot string) (map[string]string, error)

ServiceBuildDirs returns services that declare build: and the host directory to pass as docker build context (absolute path). projectRoot is the compose project directory.

Types

type Options

type Options struct {
	// TargetService is the app service whose build: block is replaced when AllBuilt is false (required then).
	TargetService string
	// ImageExpr is the YAML value for image: when ServiceImages is nil (default ${DEPLOY_IMAGE}).
	ImageExpr string
	// ServiceImages maps service name → full image reference for AllBuilt mode. When non-nil,
	// every service with build: must appear in the map; each gets that literal image: value.
	// When nil and AllBuilt, ImageExpr is used for all built services (same tag).
	ServiceImages map[string]string
	// AllBuilt if true, every service with build: is converted to image: (same ImageExpr).
	// If false, only TargetService is converted and any other service with build: is an error.
	AllBuilt bool
}

Options controls GenerateForArtifacts.

Jump to

Keyboard shortcuts

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