From c32f0aea60bee486e373079ea60015b2b6a64181 Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Mon, 12 Nov 2018 22:22:11 +0100 Subject: [PATCH] Only check for updates once every vm-boot. Speeds up provisioning. fixes #22 --- provision.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/provision.sh b/provision.sh index 90c7099..eeb2084 100755 --- a/provision.sh +++ b/provision.sh @@ -5,14 +5,21 @@ cd /vagrant ############################### # Get Docker + Docker-Compose # ############################### -apt-get update -apt-get install -y -q apt-transport-https vim +# Check for updates only once per boot. +dpkg-query -W docker-ce docker-compose &>/dev/null || rm -f /tmp/apt_run_this_boot -wget -q "https://download.docker.com/linux/debian/gpg" -O - | apt-key add -echo "deb https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker_com.list +if [ ! -f /tmp/apt_run_this_boot ]; then + apt-get update + apt-get install -y -q apt-transport-https vim -apt-get update -apt-get install -y -q docker-ce docker-compose + wget -q "https://download.docker.com/linux/debian/gpg" -O - | apt-key add + echo "deb https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker_com.list + + apt-get update + apt-get install -y -q docker-ce docker-compose + + date -Isec > /tmp/apt_run_this_boot +fi ############################# # remove running containers # -- 2.43.0