Last active
August 29, 2015 14:07
-
-
Save nrkruk/be93cb4a13f724fa0a47 to your computer and use it in GitHub Desktop.
Method for installing docker using vagrant instead of the boot2docker install. Mainly used as a workaround for windows file sharing and port forwarding issues with Virtual Box
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 : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| $script = <<SCRIPT | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| echo 'deb http://get.docker.io/ubuntu docker main' > \ | |
| /etc/apt/sources.list.d/docker.list | |
| apt-get update -q | |
| apt-get install -q -y lxc-docker | |
| usermod -a -G docker vagrant | |
| SCRIPT | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| config.vm.provision :shell, :inline => $script | |
| end | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| #Add or remove ports here as needed | |
| config.vm.network "forwarded_port", guest: 8080, host_ip: '127.0.0.1', host: 8080 #My Node App Port | |
| config.vm.network "forwarded_port", guest: 27017, host_ip: '127.0.0.1', host: 27017 #Mongo Default Port | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment