ComposeFile
Represents a Docker Compose file with properties and configurations for services, networks, volumes, secrets, configs, and custom extensions.
type ComposeFile interface{}Properties
Configs*Dict[string, Config] get · setConfig class that contains the associated configuration details.Configs() *Dict[string, Config]SetConfigs(value *Dict[string, Config]) ComposeFileExtensions*Dict[string, any] get · setExtensions() *Dict[string, any]SetExtensions(value *Dict[string, any]) ComposeFileName*stringget · setName() (*string, error)SetName(value *string) ComposeFileNetworks*Dict[string, Network] get · setNetworks() *Dict[string, Network]SetNetworks(value *Dict[string, Network]) ComposeFileSecrets*Dict[string, Secret] get · setSecrets() *Dict[string, Secret]SetSecrets(value *Dict[string, Secret]) ComposeFileServices*Dict[string, Service] get · setService class.Services() *Dict[string, Service]SetServices(value *Dict[string, Service]) ComposeFileVersion*stringget · setVersion() (*string, error)SetVersion(value *string) ComposeFileVolumes*Dict[string, Volume] get · setVolumes() *Dict[string, Volume]SetVolumes(value *Dict[string, Volume]) ComposeFileMethods
AddConfig AddConfig( name string, options ...*AddConfigOptions,) ComposeFileParameters
namestringThe name of the config.options...*AddConfigOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddConfigOptions argument.
File*stringThe path to the config file.Content*stringThe inline config content.External*boolA value indicating whether the config is managed outside the generated Compose file.Configurefunc(obj Config) callbackAn optional callback for further config customization.Returns
ComposeFile The updated Docker Compose file.
Returns a handle; failures surface later via Err().
AddNetwork AddNetwork( name string, options ...*AddNetworkOptions,) ComposeFileParameters
namestringThe name of the network.options...*AddNetworkOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddNetworkOptions argument.
Driver*stringThe network driver to use.External*boolA value indicating whether the network is managed outside the generated Compose file.Configurefunc(obj Network) callbackAn optional callback for further network customization.Returns
ComposeFile The updated Docker Compose file.
Returns a handle; failures surface later via Err().
AddSecret AddSecret( name string, options ...*AddSecretOptions,) ComposeFileParameters
namestringThe name of the secret.options...*AddSecretOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddSecretOptions argument.
File*stringThe path to the secret file.External*boolA value indicating whether the secret is managed outside the generated Compose file.Configurefunc(obj Secret) callbackAn optional callback for further secret customization.Returns
ComposeFile The updated Docker Compose file.
Returns a handle; failures surface later via Err().
AddService AddService( name string, options ...*AddServiceOptions,) ComposeFileParameters
namestringThe name of the service.options...*AddServiceOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddServiceOptions argument.
Image*stringThe container image to use for the service.Configurefunc(obj Service) callbackAn optional callback for further service customization.Returns
ComposeFile The updated Docker Compose file.
Returns a handle; failures surface later via Err().
AddVolume AddVolume( name string, options ...*AddVolumeOptions,) ComposeFileParameters
namestringThe name of the volume.options...*AddVolumeOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddVolumeOptions argument.
Driver*stringThe volume driver to use.External*boolA value indicating whether the volume is managed outside the generated Compose file.Configurefunc(obj Volume) callbackAn optional callback for further volume customization.Returns
ComposeFile The updated Docker Compose file.
Returns a handle; failures surface later via Err().