From a7cbd99e599918c15edcc9428d372cb873dfcadc Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Wed, 16 Nov 2022 17:17:19 +0100 Subject: [PATCH] Improve docker check in install script If found that the install script was not running in the `docker:stable` docker container unless I created the directory `~/.docker` manually, which does not exist by default. I thought it would be better than instead of just checking for this directory, to also check if the docker command is available before giving up on trying to install. --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 302251e..80437b0 100755 --- a/install.sh +++ b/install.sh @@ -640,7 +640,7 @@ main() ( tag=$1 if [ "${install_dir}" = "${DEFAULT_INSTALL_DIR}" ]; then - if [ ! -d "${DOCKER_HOME}" ]; then + if [ ! -d "${DOCKER_HOME}" ] && ! which docker > /dev/null 2>&1; then log_err "docker is not installed; refusing to install to '${install_dir}'" exit 1 fi @@ -706,4 +706,4 @@ if [ -z "${TEST_INSTALL_SH}" ]; then set -u main "$@" fi -set -u \ No newline at end of file +set -u