Skip to content

Instantly share code, notes, and snippets.

Created Nov 20, 2017
What would you like to do?
Ubuntu, Setting up a docker development env with Vagrant
$script = <<SCRIPT
# Set up the repository
echo “Update the apt package index...”
sudo apt-get update -y
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y
curl -fsSL | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
# Install Docker CE
echo “Install Docker CE...”
sudo apt-get update -y
sudo apt-get install docker-ce -y
sudo usermod -aG docker $USER
echo “Docker CE installed successfully”
# Install Docker Compose
sudo apt-get -y install python-pip
sudo pip install docker-compose
Vagrant.configure("2") do |config|
config.vm.hostname = "docker1.local" = "ubuntu/xenial64" "private_network", ip: "" "forwarded_port", guest: 80, host: 80
config.vm.provider "virtualbox" do |vb| = "docker-node-1"
vb.memory = 1024
vb.cpus = 1
config.vm.provision "shell", inline: $script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment