From dff527ce6718aed0f2354a7cadf5a39f86e0ac48 Mon Sep 17 00:00:00 2001 From: lukewaite Date: Tue, 7 Apr 2015 16:23:34 -0400 Subject: [PATCH] Added an option (on by default for new users) to have the vagrant user added to the docker group --- Vagrantfile | 3 +-- scripts/docker.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 60191acf..eab8a81a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -188,8 +188,7 @@ Vagrant.configure("2") do |config| # config.vm.provision "shell", path: "#{github_url}/scripts/vim.sh", args: github_url # Provision Docker - # config.vm.provision "shell", path: "#{github_url}/scripts/docker.sh" - + # config.vm.provision "shell", path: "#{github_url}/scripts/docker.sh", args: "permissions" #### # Web Servers diff --git a/scripts/docker.sh b/scripts/docker.sh index 428ce8dc..2a51764b 100644 --- a/scripts/docker.sh +++ b/scripts/docker.sh @@ -12,3 +12,13 @@ sudo apt-get update # Install Docker # -qq implies -y --force-yes sudo apt-get install -qq lxc-docker + +# Make the vagrant user able to interact with docker without sudo +if [ ! -z "$1" ]; then + if [ "$1" == "permissions" ]; then + echo ">>> Adding vagrant user to docker group" + + sudo usermod -a -G docker vagrant + + fi # permissions +fi # arg check