title: tcp_keepalive_time in docker container
body: <p>I have a docker host that has set a <code>net.ipv4.tcp_keepalive_time</code> kernel parameter to 600. But when a container runs, it uses a different value: </p>
  
  <pre><code>$ sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 600
  
  $ docker run --rm ubuntu:latest sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 7200
  </code></pre>
  
  <p>Why is this and how can I change this value without having to pass <code>--sysctl</code> option?</p>
  
  <p>The reason I cannot pass <code>--sysctl</code> in my case is that this host is a docker swarm container and this option is <a href="https://github.com/moby/moby/issues/25209" rel="noreferrer">currently unsupported</a> in swarm. </p>
  
  <p>But shouldn't containers just take these kernel parameters from the host? I already restarted the docker service (and its containers). </p>
  
  <p>edit: some extra host info:</p>
  
  <pre><code>$ uname -r
  4.15.0-38-generic
  $ docker --version
  Docker version 18.06.1-ce, build e68fc7a
  </code></pre>