;
};
/**
* Secrets contains references to zero or more secrets that will be
* exposed to the service.
*
*/
Secrets?: Array<{
/**
* File represents a specific target that is backed by a file.
*
*/
File?: {
/**
* Name represents the final filename in the filesystem.
*
*/
Name?: string;
/**
* UID represents the file UID.
*/
UID?: string;
/**
* GID represents the file GID.
*/
GID?: string;
/**
* Mode represents the FileMode of the file.
*/
Mode?: number;
};
/**
* SecretID represents the ID of the specific secret that we're
* referencing.
*
*/
SecretID?: string;
/**
* SecretName is the name of the secret that this references,
* but this is just provided for lookup/display purposes. The
* secret in the reference will be identified by its ID.
*
*/
SecretName?: string;
}>;
/**
* An integer value containing the score given to the container in
* order to tune OOM killer preferences.
*
*/
OomScoreAdj?: number;
/**
* Configs contains references to zero or more configs that will be
* exposed to the service.
*
*/
Configs?: Array<{
/**
* File represents a specific target that is backed by a file.
*
*
*
* > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive
*
*/
File?: {
/**
* Name represents the final filename in the filesystem.
*
*/
Name?: string;
/**
* UID represents the file UID.
*/
UID?: string;
/**
* GID represents the file GID.
*/
GID?: string;
/**
* Mode represents the FileMode of the file.
*/
Mode?: number;
};
/**
* Runtime represents a target that is not mounted into the
* container but is used by the task
*
*
*
* > **Note**: `Configs.File` and `Configs.Runtime` are mutually
* > exclusive
*
*/
Runtime?: any;
/**
* ConfigID represents the ID of the specific config that we're
* referencing.
*
*/
ConfigID?: string;
/**
* ConfigName is the name of the config that this references,
* but this is just provided for lookup/display purposes. The
* config in the reference will be identified by its ID.
*
*/
ConfigName?: string;
}>;
/**
* Isolation technology of the containers running the service.
* (Windows only)
*
*/
Isolation?: 'default' | 'process' | 'hyperv' | '';
/**
* Run an init inside the container that forwards signals and reaps
* processes. This field is omitted if empty, and the default (as
* configured on the daemon) is used.
*
*/
Init?: boolean | null;
/**
* Set kernel namedspaced parameters (sysctls) in the container.
* The Sysctls option on services accepts the same sysctls as the
* are supported on containers. Note that while the same sysctls are
* supported, no guarantees or checks are made about their
* suitability for a clustered environment, and it's up to the user
* to determine whether a given sysctl will work properly in a
* Service.
*
*/
Sysctls?: Record;
/**
* A list of kernel capabilities to add to the default set
* for the container.
*
*/
CapabilityAdd?: Array;
/**
* A list of kernel capabilities to drop from the default set
* for the container.
*
*/
CapabilityDrop?: Array;
/**
* A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
*
*/
Ulimits?: Array<{
/**
* Name of ulimit
*/
Name?: string;
/**
* Soft limit
*/
Soft?: number;
/**
* Hard limit
*/
Hard?: number;
}>;
};
/**
* Read-only spec type for non-swarm containers attached to swarm overlay
* networks.
*
*
*
* > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are
* > mutually exclusive. PluginSpec is only used when the Runtime field
* > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime
* > field is set to `attachment`.
*
*/
NetworkAttachmentSpec?: {
/**
* ID of the container represented by this task
*/
ContainerID?: string;
};
/**
* Resource requirements which apply to each individual container created
* as part of the service.
*
*/
Resources?: {
/**
* Define resources limits.
*/
Limits?: Limit;
/**
* Define resources reservation.
*/
Reservations?: ResourceObject;
/**
* Amount of swap in bytes - can only be used together with a memory limit.
* If not specified, the default behaviour is to grant a swap space twice
* as big as the memory limit.
* Set to -1 to enable unlimited swap.
*
*/
SwapBytes?: number | null;
/**
* Tune the service's containers' memory swappiness (0 to 100).
* If not specified, defaults to the containers' OS' default, generally 60,
* or whatever value was predefined in the image.
* Set to -1 to unset a previously set value.
*
*/
MemorySwappiness?: number | null;
};
/**
* Specification for the restart policy which applies to containers
* created as part of this service.
*
*/
RestartPolicy?: {
/**
* Condition for restart.
*/
Condition?: 'none' | 'on-failure' | 'any';
/**
* Delay between restart attempts.
*/
Delay?: number;
/**
* Maximum attempts to restart a given container before giving up
* (default value is 0, which is ignored).
*
*/
MaxAttempts?: number;
/**
* Windows is the time window used to evaluate the restart policy
* (default value is 0, which is unbounded).
*
*/
Window?: number;
};
Placement?: {
/**
* An array of constraint expressions to limit the set of nodes where
* a task can be scheduled. Constraint expressions can either use a
* _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find
* nodes that satisfy every expression (AND match). Constraints can
* match node or Docker Engine labels as follows:
*
* node attribute | matches | example
* ---------------------|--------------------------------|-----------------------------------------------
* `node.id` | Node ID | `node.id==2ivku8v2gvtg4`
* `node.hostname` | Node hostname | `node.hostname!=node-2`
* `node.role` | Node role (`manager`/`worker`) | `node.role==manager`
* `node.platform.os` | Node operating system | `node.platform.os==windows`
* `node.platform.arch` | Node architecture | `node.platform.arch==x86_64`
* `node.labels` | User-defined node labels | `node.labels.security==high`
* `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04`
*
* `engine.labels` apply to Docker Engine labels like operating system,
* drivers, etc. Swarm administrators add `node.labels` for operational
* purposes by using the [`node update endpoint`](#operation/NodeUpdate).
*
*/
Constraints?: Array;
/**
* Preferences provide a way to make the scheduler aware of factors
* such as topology. They are provided in order from highest to
* lowest precedence.
*
*/
Preferences?: Array<{
Spread?: {
/**
* label descriptor, such as `engine.labels.az`.
*
*/
SpreadDescriptor?: string;
};
}>;
/**
* Maximum number of replicas for per node (default value is 0, which
* is unlimited)
*
*/
MaxReplicas?: number;
/**
* Platforms stores all the platforms that the service's image can
* run on. This field is used in the platform filter for scheduling.
* If empty, then the platform filter is off, meaning there are no
* scheduling restrictions.
*
*/
Platforms?: Array;
};
/**
* A counter that triggers an update even if no relevant parameters have
* been changed.
*
*/
ForceUpdate?: number;
/**
* Runtime is the type of runtime specified for the task executor.
*
*/
Runtime?: string;
/**
* Specifies which networks the service should attach to.
*/
Networks?: Array;
/**
* Specifies the log driver to use for tasks created from this spec. If
* not present, the default one for the swarm will be used, finally
* falling back to the engine default if not specified.
*
*/
LogDriver?: {
Name?: string;
Options?: Record;
};
};