Using Docker and Vagrant on Mac OS X with a Ruby on Rails application
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pgsql
rails
redis
.gitignore
README.md
Vagrantfile

README.md

PostgreSQL container

PGSQL=$(sudo docker run -p 5432:5432 -name pgsql -d project/pgsql /usr/bin/start_pgsql.sh YOURPASSWORD) PGSQL_IP=$(sudo docker inspect $PGSQL | grep IPAddress | awk '{ print $2 }' | tr -d ',"')

Connect through the client

psql -h $PGSQL_IP -Uroot -d postgres

Redis container

REDIS=$(sudo docker run -p 6379:6379 -d -name redis project/redis) REDIS_IP=$(sudo docker inspect $REDIS | grep IPAddress | awk '{ print $2 }' | tr -d ',"')

Verify that containers are working

docker ps $PGSQL docker ps $REDIS

VMware Fusion folder mapping and container linking

sudo docker run -i -p 80:80 -name rails -v /mnt/hgfs/project/rails/src:/var/www/project -link pgsql:pgsql -link redis:redis -t project/rails /bin/bash

VirtualBox / Vagrant folder mapping and container linking

sudo docker run -i -privileged -p 80:80 -name rails -v /vagrant/rails/src:/var/www/project -link pgsql:pgsql -link redis:redis -t project/rails /bin/bash

Bitdeli Badge