ComposeFile Methods
Class Methods 5 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
config Config The config instance to add to the Compose file. Returns
ComposeFile The 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
network Network The network instance to add to the Compose file. Returns
ComposeFile The 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
service Service The service instance to add to the Compose file. Returns
ComposeFile The 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
volume Volume The volume instance to add to the Compose file. Returns
ComposeFile The 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
lineEndings string optional Specifies the line endings to be used in the serialized YAML output. Defaults to "\n". Returns
string A string containing the YAML representation of the ComposeFile instance.