Last active
September 13, 2017 22:17
-
-
Save eduardomp/c53261d411cb44ea5ee5baa99743e2a7 to your computer and use it in GitHub Desktop.
Vagrantfile used to create a virtual machine whith docker, nodejs, phantonjs and git... Ubuntu 14.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.box_check_update = false | |
#exposing port 8080 to access from the host machine | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 ,auto_correct: true | |
#development folder shared between host machine and this virtual machine | |
config.vm.synced_folder "./workspace", "/home/vagrant/workspace" | |
config.vm.provision "shell", inline: <<-SHELL | |
echo "#### Update ubuntu packages... ###" | |
sudo apt-get update | |
echo "### installing CURL... ###" | |
sudo apt-get install -y curl | |
echo "### installing GIT... ###" | |
sudo apt-get install -y git | |
echo "### installing PhantomJs ###" | |
sudo apt-get install -y libfontconfig | |
wget "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2" | |
sudo tar xjf phantomjs-2.1.1-linux-x86_64.tar.bz2 | |
sudo cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /bin | |
echo "### installing NodeJS... ###" | |
wget "https://nodejs.org/dist/v6.11.3/node-v6.11.3-linux-x64.tar.xz" | |
sudo tar -C /usr/local --strip-components 1 -xf node-v6.11.3-linux-x64.tar.xz | |
echo "### installing Docker... ###" | |
sudo apt-get -y install docker.io | |
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker | |
sudo update-rc.d docker defaults | |
echo "### removing unnecessary files ... ###" | |
sudo rm -rf node-v6.11.3-linux-x64.tar.xz phantomjs-2.1.1-linux-x86_64.tar.bz2 | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment