title: How to fix the WARNINGs when running the redis:alpine Docker image
body: <p>If I run the <a href="https://hub.docker.com/_/redis/" rel="noreferrer">redis:alpine</a> Docker image using the commmand</p>
  
  <pre><code>docker run redis:alpine
  </code></pre>
  
  <p>I see several warnings:</p>
  
  <pre><code>1:C 08 May 08:29:32.308 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
                  _._                                                  
             _.-``__ ''-._                                             
        _.-``    `.  `_.  ''-._           Redis 3.2.8 (00000000/0) 64 bit
    .-`` .-```.  ```\/    _.,_ ''-._                                   
   (    '      ,       .-`  | `,    )     Running in standalone mode
   |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
   |    `-._   `._    /     _.-'    |     PID: 1
    `-._    `-._  `-./  _.-'    _.-'                                   
   |`-._`-._    `-.__.-'    _.-'_.-'|                                  
   |    `-._`-._        _.-'_.-'    |           http://redis.io        
    `-._    `-._`-.__.-'_.-'    _.-'                                   
   |`-._`-._    `-.__.-'    _.-'_.-'|                                  
   |    `-._`-._        _.-'_.-'    |                                  
    `-._    `-._`-.__.-'_.-'    _.-'                                   
        `-._    `-.__.-'    _.-'                                       
            `-._        _.-'                                           
                `-.__.-'                                               
  
  1:M 08 May 08:29:32.311 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
  1:M 08 May 08:29:32.311 # Server started, Redis version 3.2.8
  1:M 08 May 08:29:32.311 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
  1:M 08 May 08:29:32.311 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
  1:M 08 May 08:29:32.311 * The server is now ready to accept connections on port 6379
  </code></pre>
  
  <p>I've tried to fix the first two of these warnings using the following <code>Dockerfile</code>:</p>
  
  <pre><code>FROM redis:alpine
  COPY somaxconn /proc/sys/net/core/somaxconn
  COPY sysctl.conf /etc/sysctl.conf
  CMD ["redis-server", "--appendonly", "yes"]
  </code></pre>
  
  <p>where my local file <code>somaxconn</code> contains the single entry <code>511</code> and <code>sysctl.conf</code> contains the line <code>vm.overcommit_memory = 1</code>. However, I still get the same warnings when I build and run the container.</p>
  
  <p>How can I get rid of these warnings? (There is mention of the issues in <a href="https://www.techandme.se/performance-tips-for-redis-cache-server/" rel="noreferrer">https://www.techandme.se/performance-tips-for-redis-cache-server/</a> but the solution described there, involving modifying <a href="https://www.raspberrypi.org/documentation/linux/usage/rc-local.md" rel="noreferrer">rc.local</a>, seems to pertain to Rasperry Pi).</p>