Prepare image which is installed muliple versions of ruby and bundler for each versions.
You can use this image for your project soon. It's uploaded docker.io, tcnksm/rbenv.
docker pull tcnksm/rbenv
or in Dockerfile
FROM tcnksm/rbenv
Run it !
docker run -i -t tcnksm/rbenv bash -l -c 'rbenv global 2.0.0-p353; bundle ...'
Install multiple versions of ruby by rbenv. you can define ruby verion which you want to use in versions.txt
.
Use Vagrant for VM running docker. Vagrant 1.4 has a Docker provisioner. Download it here.
After installed.
vagrant up
And login to VM.
vagrant ssh
Now you can use docker in VM.
docker build -t TAG .
Dockerfile execute belows;
- Pull base image (this time ubuntu)
- Install packages which are needed to build ruby
- Clone rbenv
- Clone ruby-build
- Install multiple versions of ruby which are defined at
versions.txt
- Install Bundler for each version