Docker 0.9 – /etc/sysctl.conf not working

I set net.core.somaxconn = 65535 in /etc/sysctl.conf inside an Ubuntu image.

But the net.core.somaxconn turns to 128 in the container using command sysctl -a | grep net.core.somaxconn.

  • Docker IP changes makes locking down MySQL access tricky
  • Database location in Microservices Architecture
  • Deploy NoneJS application with Docker
  • How can I use dynamic linking in a Docker image based on busybox?
  • Kibana docker run
  • How do I enable “debug” logging of the Docker daemon? (Ubuntu 16.04)
  • After I execute sysctl -p, it turns to 65535.

    Why doesn’t /etc/sysctl.conf work when running a container (Docker 0.9) ?

  • mysql in docker container hangs
  • Consul Empty reply from server
  • Setting arguments in docker-compose file
  • Running Nginx on Docker
  • Exception when running Spark job server in spark standalone mode
  • Docker and pip requirements
  • One Solution collect form web for “Docker 0.9 – /etc/sysctl.conf not working”

    This is probably the case because Docker does not run sysctl for you. I don’t know how you start your container, but if you do something like docker run -i -t image /bin/bash it only starts bash. There is no upstart kicked of or anything, so if you decide running sysctl is important, you need to do that yourself.

    For development purposes, you can use

    docker run -i -t image sysctl -p && /bin/bash

    For production use, you might want to take a look at supervisor or at my blog on that.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.