ComposeFile Methods
ClassMethods5 members
Represents a Docker Compose file with properties and configurations for services, networks, volumes, secrets, configs, and custom extensions.
Adds a new config entry to the Compose file.
public sealed class ComposeFile{ public ComposeFile AddConfig( Config config) { // ... }}Parameters
configConfigThe config instance to add to the Compose file.Returns
ComposeFileThe updated ComposeFile instance with the added config. Adds a new network to the Compose file.
public sealed class ComposeFile{ public ComposeFile AddNetwork( Network network) { // ... }}Parameters
networkNetworkThe network instance to add to the Compose file.Returns
ComposeFileThe updated ComposeFile instance with the added network. Adds a new service to the Compose file.
public sealed class ComposeFile{ public ComposeFile AddService( Service service) { // ... }}Parameters
serviceServiceThe service instance to add to the Compose file.Returns
ComposeFileThe updated ComposeFile instance containing the added service. Adds a new volume to the Compose file.
public sealed class ComposeFile{ public ComposeFile AddVolume( Volume volume) { // ... }}Parameters
volumeVolumeThe volume instance to add to the Compose file.Returns
ComposeFileThe updated ComposeFile instance with the added volume. Converts the current instance of
ComposeFile to its YAML string representation. public sealed class ComposeFile{ public string ToYaml( string lineEndings = "\n") { // ... }}Parameters
lineEndingsstringoptionalSpecifies the line endings to be used in the serialized YAML output. Defaults to "\n".Returns
stringA string containing the YAML representation of the ComposeFile instance.