title: Docker container sending empty responses
body: <p>Hoping someone can tell me what I am missing? This is a ruby app using webrick and I am trying to containerize the app. Running on Mac OSX 10.12.3 Sierra. Here is my Dockerfile</p>
  
  <pre><code>FROM ruby:2.4.0-alpine
  RUN apk add --no-cache gcc musl-dev libstdc++ g++ make
  RUN gem install jekyll bundler redcarpet
  RUN mkdir -p /usr/app/jekyll
  COPY . /usr/app/jekyll
  WORKDIR /usr/app/jekyll
  EXPOSE 4000:4000
  CMD ["jekyll", "serve"]
  </code></pre>
  
  <p>Here is how the image is built</p>
  
  <pre><code>docker build -t chb0docker/cheat .
  </code></pre>
  
  <p>if I run the service directly on the host, it runs fine</p>
  
  <pre><code>Violas-MacBook-Pro:progfun-wiki cbongiorno$ jekyll serve &amp;
  [1] 49286
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ Configuration file: /Users/cbongiorno/development/progfun-wiki/_config.yml
  Configuration file: /Users/cbongiorno/development/progfun-wiki/_config.yml
              Source: /Users/cbongiorno/development/progfun-wiki
         Destination: /Users/cbongiorno/development/progfun-wiki/_site
   Incremental build: disabled. Enable with --incremental
        Generating... 
                      done in 0.409 seconds.
   Auto-regeneration: enabled for '/Users/cbongiorno/development/progfun-wiki'
  Configuration file: /Users/cbongiorno/development/progfun-wiki/_config.yml
      Server address: http://127.0.0.1:4000/
    Server running... press ctrl-c to stop.
  </code></pre>
  
  <p>verify the server is up:</p>
  
  <pre><code>Violas-MacBook-Pro:progfun-wiki cbongiorno$ curl localhost:4000 2&gt; /dev/null | wc -l
        40
  </code></pre>
  
  <p>now run it in docker:</p>
  
  <pre><code>Violas-MacBook-Pro:progfun-wiki cbongiorno$ fg
  jekyll serve
  ^C
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ docker run -d --name jekyll -p 4000:4000 chb0docker/cheat 
  e766e4acb007033583885b1a3c52dc3c2dc51c6929c8466f3a4ff958f76ebc5f
  </code></pre>
  
  <p>verify the process</p>
  
  <pre><code>Violas-MacBook-Pro:progfun-wiki cbongiorno$ docker ps
  CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
  e766e4acb007        chb0docker/cheat    "jekyll serve"      19 minutes ago      Up 32 seconds       0.0.0.0:4000-&gt;4000/tcp   jekyll
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' jekyll
  172.17.0.3
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ docker logs jekyll
  Configuration file: /usr/app/jekyll/_config.yml
  Configuration file: /usr/app/jekyll/_config.yml
              Source: /usr/app/jekyll
         Destination: /usr/app/jekyll/_site
   Incremental build: disabled. Enable with --incremental
        Generating... 
                      done in 0.329 seconds.
   Auto-regeneration: enabled for '/usr/app/jekyll'
  Configuration file: /usr/app/jekyll/_config.yml
      Server address: http://127.0.0.1:4000/
    Server running... press ctrl-c to stop.
  </code></pre>
  
  <p>now try and get some data</p>
  
  <pre><code>Violas-MacBook-Pro:progfun-wiki cbongiorno$ curl localhost:4000 2&gt; /dev/null | wc -l
         0
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ curl 172.17.0.3:4000 2&gt; /dev/null | wc -l
         0
  Violas-MacBook-Pro:progfun-wiki cbongiorno$ curl 0.0.0.0:4000 2&gt; /dev/null | wc -l
         0
  </code></pre>
  
  <p>but, if we execute the above GET (with <code>wget</code> instead of <code>curl</code> because it's not installed on this container) we can see all is well inside the container</p>
  
  <pre><code> docker exec -it jekyll /usr/bin/wget -q -O - localhost:4000 | wc -l
        40
  </code></pre>
  
  <p>Is this an app issue? </p>