Connection refused on docker container
<p>I'm new to Docker and trying to make a demo Rails app. I made a dockerfile that looks like this: </p>

<pre><code>FROM ruby:2.2
MAINTAINER marko@codeship.com

# Install apt based dependencies required to run Rails as 
# well as RubyGems. As the Ruby image itself is based on a 
# Debian image, we use apt-get to install those.
RUN apt-get update &amp;&amp; apt-get install -y \
build-essential \
nodejs

    # Configure the main working directory. This is the base 
    # directory used in any further RUN, COPY, and ENTRYPOINT 
    # commands.
RUN mkdir -p /app
WORKDIR /app

    # Copy the Gemfile as well as the Gemfile.lock and install 
    # the RubyGems. This is a separate step so the dependencies 
    # will be cached unless changes to one of those two files 
    # are made.
COPY Gemfile Gemfile.lock ./
RUN gem install bundler &amp;&amp; bundle install --jobs 20 --retry 5

# Copy the main application.
COPY . ./

# Expose port 8080 to the Docker host, so we can access it 
# from the outside.
EXPOSE 8080

# The main command to run when the container starts. Also 
# tell the Rails dev server to bind to all interfaces by 
# default.
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "8080"]
</code></pre>

<p>I then built it like so: </p>

<pre><code>docker build -t demo . 
</code></pre>

<p>And call a command to start the server which does start the server on port 8080: </p>

<pre><code>Johns-MacBook-Pro:demo johnkealy$ docker run -it demo
=&gt; Booting WEBrick
=&gt; Rails 4.2.5 application starting in development on http://0.0.0.0:8080
=&gt; Run `rails server -h` for more startup options
=&gt; Ctrl-C to shutdown server
[2016-04-23 16:50:34] INFO  WEBrick 1.3.1
[2016-04-23 16:50:34] INFO  ruby 2.2.4 (2015-12-16) [x86_64-linux]
[2016-04-23 16:50:34] INFO  WEBrick::HTTPServer#start: pid=1 port=8080
</code></pre>

<p>I then try to find the correct IP to navigate to: </p>

<pre><code>Johns-MacBook-Pro:demo johnkealy$ docker-machine ip default
192.168.99.100
</code></pre>

<p>I navigate to <a href="http://192.168.99.100:8080" rel="noreferrer">http://192.168.99.100:8080</a> and get the error This site can’t be reached 192.168.99.100 refused to connect.</p>

<p>What could I be doing wrong ? </p>