Skip to content

Instantly share code, notes, and snippets.

@garretfick
Created June 21, 2017 03:03
Show Gist options
  • Save garretfick/168a8b6f29bc2d11cb50696d91a91ee6 to your computer and use it in GitHub Desktop.
Save garretfick/168a8b6f29bc2d11cb50696d91a91ee6 to your computer and use it in GitHub Desktop.
Vagrant file that creates a Linux machine with docker and setup to run the docker operations training
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo apt-get -y update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-compose awscli jq pssh wkhtmltopdf
sudo ln -s /usr/bin/parallel-ssh /usr/bin/pssh
ssh-keygen -f ~/.ssh/id_rsa
git clone https://github.com/jpetazzo/orchestration-workshop.git
cd orchestration-workshop/prepare-vms
docker-compose build
SCRIPT
# After SSH into the box, run the following:
# eval $(ssh-agent) > /dev/null
# ssh-add
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = "dockertraining"
config.vm.synced_folder ".", "/var/www/public", :mount_options => ["dmode=777", "fmode=666"]
config.vm.provision "shell", inline: $script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment