Created
April 19, 2017 14:43
-
-
Save Slach/03b6d37ecc913ae65d4c14aac179238e to your computer and use it in GitHub Desktop.
run docker under vagrant with minimal provision
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/xenial64" | |
| config.vm.box_check_update = false | |
| # Provider-specific configuration so you can fine-tune various | |
| # backing providers for Vagrant. These expose provider-specific options. | |
| # Example for VirtualBox: | |
| # | |
| config.vm.provider "virtualbox" do |vb| | |
| # Display the VirtualBox GUI when booting the machine | |
| vb.gui = false | |
| # Customize the amount of memory on the VM: | |
| vb.memory = "2048" | |
| end | |
| config.vm.provision "shell", inline: <<-SHELL | |
| sudo sysctl net.ipv6.conf.all.forwarding=1 && \ | |
| sudo apt-get update && \ | |
| sudo apt-get install -y apt-transport-https software-properties-common aptitude && \ | |
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
| sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main" && \ | |
| sudo apt-get update && \ | |
| sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual && \ | |
| sudo apt-get install -y docker-engine && \ | |
| sudo apt-get install -y python-pip && \ | |
| sudo apt-get install -y htop ethtool mc && \ | |
| sudo python -m pip install -U pip && \ | |
| sudo pip install -U docker-compose && \ | |
| echo "PROVISIONING DONE, use folloding scenario for developing:" && \ | |
| echo "# vagrant ssh " && \ | |
| echo "# sudo bash" && \ | |
| echo "# cd /vagrant" && \ | |
| echo "# docker-compose up -d" && \ | |
| echo "# docker-compose logs" && \ | |
| echo "# edit files" && \ | |
| echo "# docker-compose down" && \ | |
| echo "# docker-compose up -d" && \ | |
| echo "# docker-compose logs" && \ | |
| echo "Good Luck ;)" | |
| SHELL | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment