mirror of
https://github.com/containrrr/watchtower.git
synced 2026-03-02 10:50:16 +01:00
feat: add flag to disable to the memory swappiness
This commit is contained in:
parent
76f9cea516
commit
51a66ff65e
4 changed files with 37 additions and 10 deletions
|
|
@ -57,11 +57,12 @@ func NewClient(opts ClientOptions) Client {
|
|||
|
||||
// ClientOptions contains the options for how the docker client wrapper should behave
|
||||
type ClientOptions struct {
|
||||
RemoveVolumes bool
|
||||
IncludeStopped bool
|
||||
ReviveStopped bool
|
||||
IncludeRestarting bool
|
||||
WarnOnHeadFailed WarningStrategy
|
||||
RemoveVolumes bool
|
||||
IncludeStopped bool
|
||||
ReviveStopped bool
|
||||
IncludeRestarting bool
|
||||
DisableMemorySwappiness bool
|
||||
WarnOnHeadFailed WarningStrategy
|
||||
}
|
||||
|
||||
// WarningStrategy is a value determining when to show warnings
|
||||
|
|
@ -251,6 +252,11 @@ func (client dockerClient) StartContainer(c t.Container) (t.ContainerID, error)
|
|||
hostConfig := c.GetCreateHostConfig()
|
||||
networkConfig := client.GetNetworkConfig(c)
|
||||
|
||||
// this is a flag set for podman compatibility
|
||||
if client.DisableMemorySwappiness {
|
||||
hostConfig.MemorySwappiness = nil
|
||||
}
|
||||
|
||||
// simpleNetworkConfig is a networkConfig with only 1 network.
|
||||
// see: https://github.com/docker/docker/issues/29265
|
||||
simpleNetworkConfig := func() *network.NetworkingConfig {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue