From fa4d028f8e6d0cfc02452cd8b075b4c96948a0dc Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 6 May 2021 09:58:28 +0200 Subject: [PATCH] apply single ulimit as soft+hard limit Signed-off-by: Nicolas De Loof --- local/compose/create.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/local/compose/create.go b/local/compose/create.go index 560d76498..4df60777f 100644 --- a/local/compose/create.go +++ b/local/compose/create.go @@ -438,10 +438,18 @@ func getDeployResources(s types.ServiceConfig) container.Resources { } 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{ Name: name, - Hard: int64(u.Hard), - Soft: int64(u.Soft), + Hard: int64(soft), + Soft: int64(hard), }) } return resources