From f5a1b23862a8b013fd56d7a7ddd6f8b253a8f978 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 12 Feb 2024 10:53:25 -0500 Subject: [PATCH] Update alpine-docker-install.sh add option to install Portainer Agent --- install/alpine-docker-install.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/install/alpine-docker-install.sh b/install/alpine-docker-install.sh index 5fa141b2..61cc27f7 100644 --- a/install/alpine-docker-install.sh +++ b/install/alpine-docker-install.sh @@ -32,12 +32,13 @@ get_latest_release() { } PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer") DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose") +PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent") 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 9443:9443 \ --name=portainer \ @@ -46,8 +47,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 Docker Compose? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"