title: Access Host redis database from docker conatiner
body: <p>I am trying to connect to host redis database through my docker conatiner.</p>
  <p>In my dockerfile , I have redis as a requirement, which gets installed [pip install redis] and image is build using that docker file.
  After than I instantiate the conatiner using following command</p>
  <pre><code>sudo docker run -p 6543:6543 your_image_name
  </code></pre>
  <p>my app.py is following</p>
  <pre><code>from wsgiref.simple_server import make_server
  from pyramid.config import Configurator
  from pyramid.response import Response
  import redis
  
  def hello(request):
      ds_id = '4000'
      r_server = redis.Redis(unix_socket_path='/tmp/redis.sock')
      result = r_server.set('foo','11')
      return Response(result)
  </code></pre>
  <p>Problem is when Redis is installed in the beginning redis.sock file is not generated and thus creating error when I try to connect.</p>
  <p>Dockerfile:</p>
  <pre><code>FROM     centos:latest
  
  # load base packages w/ yum
  RUN yum install -y git gcc libffi-devel openssl-devel python-devel postgresql-devel libxml2-devel libxslt-devel
  COPY ./requirements.txt .
  
  RUN curl https://bootstrap.pypa.io/get-pip.py &gt;get-pip.py &amp;&amp; \
      python get-pip.py &amp;&amp; \
      rm get-pip.py &amp;&amp;\
      pip install -r requirements.txt
  
  EXPOSE 6543
  
  WORKDIR /app
  
  COPY app /app
  
  ENTRYPOINT [ &quot;python&quot; ]
  
  CMD [ &quot;app.py&quot; ]
  </code></pre>
  <p>requirements</p>
  <pre><code>pyramid
  cornice
  pyramid_chameleon
  pyramid_beaker
  pyramid_redis_sessions
  pyRFC3339
  oauthlib==0.7.2
  oauth2client==1.5.2
  pycrypto
  PyOpenSSL
  pymongo
  SQLAlchemy
  psycopg2
  lxml
  gspread
  jira
  waitress
  paste
  PasteDeploy
  redis
  </code></pre>
  <p>Is there any other way to connect to host redis data.</p>