diff --git a/containers/docker.go b/containers/docker.go index 39d9b59..6b7e7cb 100644 --- a/containers/docker.go +++ b/containers/docker.go @@ -352,6 +352,8 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i envList = append(envList, key+"="+value) } + pidLimit := int64(2024) + createdContainer, err := cli.ContainerCreate( context.Background(), &container.Config{ @@ -371,6 +373,7 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i Memory: int64(memory*110/100) * 1024 * 1024, // Allow 10 % more memory so we have space for MemoryReservation MemoryReservation: int64(memory) * 1024 * 1024, // This should provide softer way how to limit the memory of our containers OomKillDisable: &OOMKillDisable, + PidsLimit: &pidLimit, }, PortBindings: portBindings, AutoRemove: false,