From 39ebf79a6dc2fbacef9e0113298c981b6694525b Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 10 Jul 2023 16:18:49 -0400 Subject: [PATCH] Update docker-install.sh restrict the installation to either portainer-ce or the portainer-agent --- install/docker-install.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/install/docker-install.sh b/install/docker-install.sh index fb62433d..810def23 100644 --- a/install/docker-install.sh +++ b/install/docker-install.sh @@ -48,7 +48,7 @@ read -r -p "Would you like to add Portainer? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing Portainer $PORTAINER_LATEST_VERSION" docker volume create portainer_data >/dev/null - $STD docker run -d \ + $STD docker run -d \ -p 8000:8000 \ -p 9000:9000 \ --name=portainer \ @@ -57,21 +57,20 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then -v portainer_data:/data \ portainer/portainer-ce:latest msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION" +else + read -r -p "Would you like to add the Portainer Agent? " prompt + if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION" + $STD docker run -d \ + -p 9001:9001 \ + --name portainer_agent \ + --restart=always \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /var/lib/docker/volumes:/var/lib/docker/volumes \ + portainer/agent + msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION" + fi fi - -read -r -p "Would you like to add the Portainer Agent? " prompt -if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION" - $STD docker run -d \ - -p 9001:9001 \ - --name portainer_agent \ - --restart=always - -v /var/run/docker.sock:/var/run/docker.sock \ - -v /var/lib/docker/volumes:/var/lib/docker/volumes \ - portainer/agent - msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION" -fi - read -r -p "Would you like to add Docker Compose? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"