title: Redis sentinel docker image / Dockerfile
body: <p>I'm looking to deploy high availability Redis on a coreOS cluster, and I need a Redis Sentinel docker image (i.e. Dockerfile) that works. I've gathered enough information/expertise to create one (I think)... but my limited knowledge/experience with advanced networking is the only thing keeping me from building and sharing it.</p>
  
  <p>Can someone who is an expert here help me developing a Redis Sentinel Dockerfile (none exist right now)? The Redis/Docker community would really benefit from this.</p>
  
  <p>Here's the broader issue and context:
  <a href="https://github.com/antirez/redis/pull/1908">https://github.com/antirez/redis/pull/1908</a></p>
  
  <p>I think the solution is right here specifically:
  <a href="https://github.com/antirez/redis/pull/1908#issuecomment-54380876">https://github.com/antirez/redis/pull/1908#issuecomment-54380876</a></p>
  
  <p>Here's the Dockerfile I've been using... but if you read the thread above, you'll see my comments (joshula)... it lacks the Networking fixes that mattsta is talking about. Note that because I'm using this on coreOS, any config settings in sentinel.conf are being set at run-time via the command line (hence ENTRYPOINT).</p>
  
  <pre><code># Pull base image.
  FROM dockerfile/ubuntu:latest
  
  # Install Redis.
  RUN \
    cd /tmp &amp;&amp; \
    wget http://download.redis.io/redis-stable.tar.gz &amp;&amp; \
    tar xvzf redis-stable.tar.gz &amp;&amp; \
    cd redis-stable &amp;&amp; \
    make &amp;&amp; \
    make install &amp;&amp; \
    cp -f src/redis-sentinel /usr/local/bin &amp;&amp; \
    mkdir -p /etc/redis &amp;&amp; \
    cp -f *.conf /etc/redis &amp;&amp; \
    rm -rf /tmp/redis-stable* &amp;&amp; \
    sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf &amp;&amp; \
    sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf &amp;&amp; \
    sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf &amp;&amp; \
    sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
  
  # Define mountable directories.
  VOLUME ["/data"]
  
  # Define working directory.
  WORKDIR /data
  
  # Expose ports.
  EXPOSE 26379
  
  # Define default command.
  ENTRYPOINT redis-sentinel /etc/redis/sentinel.conf
  </code></pre>