mirror of
https://github.com/docker/compose.git
synced 2025-07-25 14:44:29 +02:00
apply single ulimit as soft+hard limit
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
da2d64443f
commit
fa4d028f8e
@ -438,10 +438,18 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for name, u := range s.Ulimits {
|
for name, u := range s.Ulimits {
|
||||||
|
soft := u.Single
|
||||||
|
if u.Soft != 0 {
|
||||||
|
soft = u.Soft
|
||||||
|
}
|
||||||
|
hard := u.Single
|
||||||
|
if u.Hard != 0 {
|
||||||
|
hard = u.Hard
|
||||||
|
}
|
||||||
resources.Ulimits = append(resources.Ulimits, &units.Ulimit{
|
resources.Ulimits = append(resources.Ulimits, &units.Ulimit{
|
||||||
Name: name,
|
Name: name,
|
||||||
Hard: int64(u.Hard),
|
Hard: int64(soft),
|
||||||
Soft: int64(u.Soft),
|
Soft: int64(hard),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return resources
|
return resources
|
||||||
|
Loading…
x
Reference in New Issue
Block a user