title: Running gem install in a docker build hangs
body: <p>I have a very simple <strong>Dockerfile</strong> with the following:</p>
  
  <pre><code>FROM alpine:3.2
  
  # Install basic packages and Ruby
  RUN apk update &amp;&amp; \
  apk upgrade &amp;&amp; \
  apk add curl wget bash tar ca-certificates &amp;&amp; \
  apk add ruby ruby-bundler ruby-rdoc ruby-irb
  
  # Install Riemann-dash
  RUN gem install riemann-dash
  
  EXPOSE 4567/tcp
  
  ENTRYPOINT ["sh", "-ex", "riemann-dash"]
  </code></pre>
  
  <p>When trying to build it, it hangs on the command <code>gem install riemann-dash</code>.<br>
  If I connect to this container from another terminal (<code>docker exec -it ID /bin/sh</code>) and run the <code>gem install riemann-dash</code>, it's fine!</p>
  
  <p>Any idea what might be the problem?</p>