If you'd like a taste of Docker, here's how to get my silly Taco app running under Docker on your machine.
... using instructions from https://github.com/noplay/docker-osx
curl https://raw.github.com/noplay/docker-osx/0.8.0/docker-osx > /usr/local/bin/docker-osx
chmod +x /usr/local/bin/docker-osx
docker-osx shell
docker version
If everything works OK, keep going.....
export DB_CONTAINER_NAME=test_app_db
This pulls down the orchardup/postgresql container automatically.
docker run -d \
-name $DB_CONTAINER_NAME \
-p 5432:5432 \
-e POSTGRESQL_USER=docker_rails_app \
-e POSTGRESQL_PASS=pa$$w0rd \
-e POSTGRESQL_DB=docker_rails_app_production orchardup/postgresql
This will automatically pull down the lazyatom/docker-rails-app container I built and pushed for the talk
docker run -link $DB_CONTAINER_NAME:db lazyatom/docker-rails-app rake db:schema:load
docker run -link $DB_CONTAINER_NAME:db -t -i lazyatom/docker-rails-app rails c
You should be able to run Taco.count
and get 0
.
docker run -d \
-p 6789:5000 \
-link $DB_CONTAINER_NAME:db \
lazyatom/docker-rails-app
Then visit http://localdocker:6789/tacos - and rejoice! (note it's localdocker, not localhost)