diff --git a/config.json b/config.json index 2f9d751..57f41db 100644 --- a/config.json +++ b/config.json @@ -26,7 +26,8 @@ "capabilities": [ "CAP_NET_ADMIN", "CAP_SYS_ADMIN", - "CAP_SYS_PTRACE" + "CAP_SYS_PTRACE", + "CAP_SYS_RESOURCE" ] } } diff --git a/net-dhcp/__main__.py b/net-dhcp/__main__.py index afda870..4143d92 100644 --- a/net-dhcp/__main__.py +++ b/net-dhcp/__main__.py @@ -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)