Share via


Secret Class

Definition

Represents a Secret object in a Docker Compose configuration file.

[YamlDotNet.Serialization.YamlSerializable]
public sealed class Secret
[<YamlDotNet.Serialization.YamlSerializable>]
type Secret = class
Public NotInheritable Class Secret
Inheritance
Secret
Attributes
YamlDotNet.Serialization.YamlSerializableAttribute

Remarks

A Secret object is used to define sensitive information to be shared with containers, such as passwords, keys, or certificates. These secrets can either be externally managed or provided locally from a specific file.

Constructors

Secret()

Properties

External

Indicates whether the secret is managed externally. If set to true, the secret must already exist, as it will not be created or modified.

File

Represents the file path associated with the secret. This specifies the ___location of the file on the host system that will be used as the source for the secret in the container.

Labels

Gets or sets a collection of key-value pairs representing metadata or additional information associated with the secret. These labels can be used for categorization, identification, or other purposes as determined by the user.

Name

Gets or sets the name of the secret in the Docker Compose configuration.

Applies to