Increase file descriptor limit

TODO: Fix this hack
This commit is contained in:
Jack O'Sullivan 2019-09-21 23:37:48 +01:00
parent 717d856e50
commit 0711a747bd
2 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,8 @@
"capabilities": [
"CAP_NET_ADMIN",
"CAP_SYS_ADMIN",
"CAP_SYS_PTRACE"
"CAP_SYS_PTRACE",
"CAP_SYS_RESOURCE"
]
}
}

View File

@ -1,5 +1,6 @@
import logging
import socketserver
import resource
from werkzeug.serving import run_simple
from . import app
@ -10,5 +11,7 @@ logger = logging.getLogger('net-dhcp')
logger.setLevel(logging.DEBUG)
logger.addHandler(fh)
resource.setrlimit(resource.RLIMIT_NOFILE, (1048576, 1048576))
socketserver.TCPServer.allow_reuse_address = True
run_simple('unix:///run/docker/plugins/net-dhcp.sock', 0, app)