From a1931250935a8bf41db63a129f88fd3af89068fb Mon Sep 17 00:00:00 2001 From: Manish Date: Mon, 13 Jul 2020 16:00:53 +0530 Subject: [PATCH] Starting docker daemon if not already running (#82) --- deploy/install.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/deploy/install.sh b/deploy/install.sh index 170ed4979a..44fc4f1ba5 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -26,11 +26,22 @@ install_docker() { sudo ${package_manager} -y update --quiet echo "Installing docker" - sudo ${package_manager} -y install docker-ce docker-ce-cli containerd.io --quiet + sudo ${package_manager} -y install docker-ce docker-ce-cli containerd.io --quiet --nobest + + if [ ! -f /usr/bin/docker-compose ];then + echo "Installing docker-compose" + sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose + fi - echo "Installing docker-compose" - sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose +} + +start_docker() { + if [ `systemctl is-active docker.service` == "inactive" ];then + echo "Starting docker" + `systemctl start docker.service` + fi } echo -e "\U1F44B Thank you for trying out Appsmith! " @@ -80,7 +91,7 @@ elif [[ $mongo_option -eq 1 ]];then mongo_host="mongo" mongo_database="appsmith" read -p 'Set the mongo root user: ' mongo_root_user - read -sp 'Set the mongo password: ' mongo_root_password + read -sp 'Set the mongo password: ' mongo_root_password fi echo "" read -p 'Would you like to setup a custom domain to access appsmith? [Y/n]: ' setup_domain @@ -109,6 +120,9 @@ if ! is_command_present docker ;then install_docker fi +# Starting docker service +start_docker + # Role - Folder for directory_name in nginx certbot mongo/db opa/config appsmith-server/config do @@ -138,7 +152,6 @@ do if [ -f $install_dir/$f ] then - echo "File already exist." read -p "File $f already exist. Would you like to replace it? [Y]: " value if [ $value == "Y" -o $value == "y" -o $value == "yes" -o $value == "Yes" ]