Docker are 3 sysctls directives with no support

I have a sysctls parameter in my docker-compose, but as I understood this directive is being ignored in version 3:

sysctls:
        - net.core.somaxconn = 65536
        - net.ipv4.tcp_max_tw_buckets = 1440000
        - net.ipv4.ip_local_port_range = 1024 65000
        - net.ipv4.tcp_fin_timeout = 15
        - net.ipv4.tcp_window_scaling = 1
        - net.ipv4.tcp_max_syn_backlog = 3240000
        - fs.file-max = 20480

      

I need to find another way to set these parameters, but I can't figure out exactly how from the docs (checked by RUN and CMD) and I need a clear example showing how to do it. I understand that it usually happens from the command line like this:

sudo sysctl -w net.core.somaxconn=65536

      

Thank.

+5


source to share


1 answer


In docker-compose version 3, the option still works with docker-compose, but it doesn't work in docker suite.

This option is ignored when deploying a stack in swarm mode using a file (version 3) Compose.



This is because it sysctl

reads and changes the attributes of the system kernel, so it doesn't make sense to run it in a container. It makes sense that Docker Swarm no longer supports it, because if you have 2 stacks /docker-compose.yml all using this instruction, there will be a conflict.

Therefore, the only way to do this is to run the command on the host machine.

0


source







All Articles