add docker installation
This commit is contained in:
parent
2e4e7a036e
commit
815b915751
@ -31,46 +31,29 @@ msg_ok "Installed Docker"
|
|||||||
get_latest_release() {
|
get_latest_release() {
|
||||||
curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
||||||
}
|
}
|
||||||
PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
|
|
||||||
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose")
|
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? <y/N> " prompt
|
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
|
||||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
|
||||||
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
|
mkdir -p $DOCKER_CONFIG/cli-plugins
|
||||||
docker volume create portainer_data >/dev/null
|
curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
|
||||||
$STD docker run -d \
|
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
|
||||||
-p 8000:8000 \
|
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
|
||||||
-p 9443:9443 \
|
|
||||||
--name=portainer \
|
msg_info "Get NginxProxyManager Plus"
|
||||||
--restart=always \
|
cd /opt
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
wget -q https://raw.githubusercontent.com/ZoeyVid/NPMplus/refs/heads/develop/compose.yaml
|
||||||
-v portainer_data:/data \
|
msg_ok "Get NginxProxyManager Plus"
|
||||||
portainer/portainer-ce:latest
|
|
||||||
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
|
read -r -p "Enter your TZ Timezone (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List): " TZ_INPUT
|
||||||
else
|
read -r -p "Enter your ACME Email: " ACME_EMAIL_INPUT
|
||||||
read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt
|
|
||||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
sed -i "s|TZ=.*|TZ=$TZ_INPUT|g" /opt/compose.yaml
|
||||||
msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION"
|
sed -i "s|ACME_EMAIL=.*|ACME_EMAIL=$ACME_EMAIL_INPUT|g" /opt/compose.yaml
|
||||||
$STD docker run -d \
|
|
||||||
-p 9001:9001 \
|
msg_info "Starting NPM Plus"
|
||||||
--name portainer_agent \
|
docker compose up -d
|
||||||
--restart=always \
|
msg_ok "Started NPM Plus"
|
||||||
-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? <y/N> " prompt
|
|
||||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
||||||
msg_info "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
|
|
||||||
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
|
|
||||||
fi
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user