Starting docker daemon if not already running (#82)

This commit is contained in:
Manish 2020-07-13 16:00:53 +05:30 committed by GitHub
parent 1b3e8c91a7
commit a193125093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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" ]