I have a sysctls setting in docker-compose file, but as I understood, this directive is 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 exactly figure out how from the docs (tried RUN and CMD), and I need a clear example showing how to do this. I understand that normally from the command line it goes like this:
sudo sysctl -w net.core.somaxconn=65536
Thanks.
With version 3 docker-compose file, the option still works with docker-compose, but it does not work in docker swarm.
This option is ignored when deploying a stack in swarm mode with a (version 3) Compose file.
This is because sysctl
reads and modifies the attributes of the system kernel, so running it in a container does not make sense. It's logical that docker swarm does not support it anymore because if you have 2 stacks / docker-compose.yml all using this instruction, there would be conflict.
So the only way to do it is to run the command on the host machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With