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