From 3fc897f887989d3ac1cc2c710d584223deb4f513 Mon Sep 17 00:00:00 2001 From: slaclau <77557628+slaclau@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:14:53 +0100 Subject: [PATCH] Update docker-install.sh (#1602) Add Portainer agent --- install/docker-install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install/docker-install.sh b/install/docker-install.sh index 8240ed8f..fb62433d 100644 --- a/install/docker-install.sh +++ b/install/docker-install.sh @@ -25,6 +25,7 @@ get_latest_release() { DOCKER_LATEST_VERSION=$(get_latest_release "moby/moby") PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer") +PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent") DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose") msg_info "Installing Docker $DOCKER_LATEST_VERSION" @@ -58,6 +59,19 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION" 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"