title: How to run Redis on docker with a different configuration file?
body: <p>I would like to set a password on my Redis server running on docker. I have followed the instcruction on <a href="https://registry.hub.docker.com/_/redis/" rel="noreferrer">https://registry.hub.docker.com/_/redis/</a>:</p>
  
  <p>1.I have created a folder with a Dockerfile containing:</p>
  
  <pre><code>FROM redis  
  COPY redis.conf /usr/local/etc/redis/redis.conf  
  CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] 
  </code></pre>
  
  <p>2.I have added a redis.conf file with:  </p>
  
  <pre><code>requirepass thepassword
  </code></pre>
  
  <p>3.I built the image using:</p>
  
  <pre><code>docker build -t ouruser/redis .
  </code></pre>
  
  <p>4.I started the container:</p>
  
  <pre><code>docker run --name my-redis -p 0.0.0.0:6379:6379 -d ouruser/redis redis-server --appendonly yes
  </code></pre>
  
  <p>The redis server does not have any password ! I do not understand why. </p>