I have built a Docker image with Ruby and some gems as a starting point for my projects. Its available at: jikkujose/trial
. I am trying this out in a Mac, using the default docker-toolbox.
I am trying to use it to host a single file app. I am launching it as follows:
docker run -itdP -v .:/app jikkujose/docker
The current directory contains a file app.rb
with the following:
require 'sinatra'
class App < Sinatra::Base
set :bind, "0.0.0.0"
get '/' do
'This is interesting :)'
end
end
App.run!
I am able to attach to the container to launch the app. And the following is seen when I do: docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92498cafd985 jikkujose/trial "/bin/bash" 18 seconds ago Up 18 seconds 0.0.0.0:32780->4567/tcp boring_meitner
And I am trying to access the application using the ip obtained via docker-machine ip default
.
While trying to access the the app using curl
, I am getting the following:
curl: (7) Failed to connect to 192.168.99.100 port 32780: Connection refused