From 9edba57a232727413e41472985f4ef873125bf4d Mon Sep 17 00:00:00 2001 From: Willy Ovalle Date: Mon, 28 Mar 2022 10:20:43 +0200 Subject: [PATCH] Adding Docker Compose --- setup/docker-install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/setup/docker-install.sh b/setup/docker-install.sh index a34d5d59..26881f26 100644 --- a/setup/docker-install.sh +++ b/setup/docker-install.sh @@ -65,6 +65,7 @@ get_latest_release() { DOCKER_LATEST_VERSION=$(get_latest_release "moby/moby") PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer") +DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose") echo -en "${GN} Installing Docker $DOCKER_LATEST_VERSION... " DOCKER_CONFIG_PATH='/etc/docker/daemon.json' @@ -99,6 +100,24 @@ docker run -d \ echo -e "${CM}${CL} \r" fi +read -r -p "Would you like to add Docker Compose? " prompt +if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] +then +DOCKER_COMPOSE="Y" +else +DOCKER_COMPOSE="N" +fi + +if [[ $DOCKER_COMPOSE == "Y" ]]; then +echo -en "${GN} Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION... " + DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins + curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose + chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + docker compose version +echo -e "${CM}${CL} \r" +fi + PASS=$(grep -w "root" /etc/shadow | cut -b6); if [[ $PASS != $ ]]; then echo -en "${GN} Customizing Container... "