title: Connecting to couchdb inside docker
body: <p>I'm trying to setup a Docker image running couchDB that loads some data during the build phase. All that seems to work, but I can't connect it once it's running...</p>
  
  <pre><code>curl localhost:5984
  curl: (52) Empty reply from server
  </code></pre>
  
  <p>My Dockerfile looks like:</p>
  
  <pre><code>FROM ubuntu:16.04
  
  COPY . .
  
  # Load deps
  RUN apt-get update &amp;&amp; apt-get install -y apt-utils apt-transport-https curl
  
  # Install couchDB
  RUN echo "deb https://apache.bintray.com/couchdb-deb xenial main" \
      | tee -a /etc/apt/sources.list
  
  RUN curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \
      | apt-key add -
  
  RUN apt-get update &amp;&amp; apt-get install -y couchdb
  
  # Load data
  RUN ./myLoadScript.sh
  
  # Expose couchDB port
  EXPOSE 5984
  
  # Start couchDB
  CMD ["/opt/couchdb/bin/couchdb"]
  
  </code></pre>
  
  <p>and I build and run it with:</p>
  
  <pre><code>docker build --tag=database .
  docker run -p 5984:5984 database
  </code></pre>
  
  <p>Any thoughts?</p>
  
  <p>Thanks in advance,<br>
  Dan</p>