From 2975ec40be75449dacf02f6595c1d9eee50ecbf1 Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Wed, 8 Dec 2021 04:57:07 -0800 Subject: [PATCH] provision: Only install docker if not already installed Install docker only if not already installed. This allows building on top of image stages that already install docker before these provisioning steps. Signed-off-by: Jarno Rajahalme --- provision/ubuntu/install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/provision/ubuntu/install.sh b/provision/ubuntu/install.sh index 1831e3f..4be7b70 100755 --- a/provision/ubuntu/install.sh +++ b/provision/ubuntu/install.sh @@ -169,10 +169,12 @@ EOF # wget https://packages.cloud.google.com/apt/doc/apt-key.gpg # apt-key add apt-key.gpg -#Install packages -sudo apt-get update -sudo apt-get install -y docker-ce -sudo usermod -aG docker ${USERNAME} +# Install docker if not already installed +if ! which docker > /dev/null; then + sudo apt-get update + sudo apt-get install -y docker-ce + sudo usermod -aG docker ${USERNAME} +fi # Install clang/llvm # This should always converge to use the same LLVM version as in