Last active
August 29, 2015 14:14
-
-
Save btoone/87af172e7e1d77eec699 to your computer and use it in GitHub Desktop.
Setup VM and Install Docker
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
ENV['VAGRANT_DEFAULT_PROVIDER'] ||= 'virtualbox' | |
# Install Docker.io | |
# Adapted from https://docs.docker.com/installation/debian/ | |
$script = <<SCRIPT | |
echo "[SCRIPT] Running as: `whoami`" | |
echo "\n[SCRIPT] Updating ..." | |
apt-get update | |
echo "\n[SCRIPT] Installing Docker.io" | |
apt-get install -y docker.io | |
echo "\n[SCRIPT] Modifying vagrant user groups" | |
# Add the docker group if it doesn't already exist. | |
groupadd docker | |
# Add the vagrant user to the docker group. | |
usermod -a -G docker vagrant | |
echo "\n[SCRIPT] Restarting Docker daemon" | |
service docker.io restart | |
exit 0 | |
SCRIPT | |
Vagrant.configure(2) do |config| | |
# Vagrant knows to look on Atlas to find this box if it is not already installed. | |
# This box is Docker friendly but does not have docker installed. See | |
# https://github.com/phusion/open-vagrant-boxes for more detail. | |
config.vm.box = "phusion/ubuntu-14.04-amd64" | |
# Remember, shell provisioning is always ran as root | |
# config.vm.provision "shell", inline: $script <- Un-necessary since docker provisioner installs docker | |
# The docker provisioner also installs docker to the vm | |
config.vm.provision "docker", | |
images: ["ubuntu"] | |
end |
Discovered that the $script
is not necessary since the docker provisioner will install Docker for you.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After running
vagrant up
confirm the Docker installInspect Docker processes