RestartPolicy.MaxAttempts Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the maximum number of restart attempts allowed for a container as part of the restart policy.
[YamlDotNet.Serialization.YamlMember(Alias="max_attempts")]
public int? MaxAttempts { get; set; }
[<YamlDotNet.Serialization.YamlMember(Alias="max_attempts")>]
member this.MaxAttempts : Nullable<int> with get, set
Public Property MaxAttempts As Nullable(Of Integer)
Property Value
- Attributes
-
YamlDotNet.Serialization.YamlMemberAttribute
Remarks
Defines the upper limit for how many times Docker will attempt to restart the container before giving up. If not set, the system default behavior or an unlimited restart attempts policy may be applied. This setting is useful for handling scenarios where a service is repeatedly failing and prevents infinite restart loops.