Why should I use docker instead my old Vagrant style?
- Try something new.
- Vagrant uses a whole virtual machine while docker is a container. So, you application is containerzed inside a runtime needed to run. So, whatever you ship you app (container) the runtime will be shipped together.
Why should I use this image?
Are you a rails developer? This image contains all you need to build your container with your rails application.
It has rvm for managing rubies as well another tools.
Ok, so how to use this?
Pull the Image from docker.io
docker pull contatovizir/developer-image
Navigate to your directory application
Run a container with your app inside with a bash shell
docker run -ti -u deploy -p 3000:3000 -v $PWD:/project:rw contatovizir/developer-image:0.3 /bin/bash -l
"Oh My God!!" You, as a developer say..
I know, it's a huge command line, but here is the magic.
You are running /bin/bash as a user deploy (default of my image), sending the current folder to the home directory from deploy user, synchronized (-v $PWD:/project:rw).
Once logged in the container, rvm will check using your Gemfile if the app's ruby version is instaled and create the application gemsets
ruby-2.0.0-p481 - #gemset created /usr/local/rvm/gems/ruby-2.0.0-p481@vizir-management-hub ruby-2.0.0-p481 - #generating vizir-management-hub wrappers.......... deploy@bd4f666276cf:/project$
Now you are ready to start working.
Run a bundle install to install the app's Gems.
- Easily support for run DB containers (mysql or postgresql) and memory DB (redis and memcached) from the image and create mapping between them.
- Document for committing the changes to a container
- And So on.
Feedback is appreciated.