mirror of
https://github.com/Dokploy/website.git
synced 2026-07-24 15:25:24 +02:00
added proxmox lxc detection to script and fall back to --endpoint-mode dnsrr
This commit is contained in:
committed by
GitHub
parent
fac46011b3
commit
e005f64272
@@ -1,4 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Function to detect if running in Proxmox LXC container
|
||||||
|
is_proxmox_lxc() {
|
||||||
|
# Check for LXC in environment
|
||||||
|
if [ -n "$container" ] && [ "$container" = "lxc" ]; then
|
||||||
|
return 0 # LXC container
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for LXC in /proc/1/environ
|
||||||
|
if grep -q "container=lxc" /proc/1/environ 2>/dev/null; then
|
||||||
|
return 0 # LXC container
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1 # Not LXC
|
||||||
|
}
|
||||||
|
|
||||||
install_dokploy() {
|
install_dokploy() {
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "This script must be run as root" >&2
|
echo "This script must be run as root" >&2
|
||||||
@@ -39,6 +55,19 @@ install_dokploy() {
|
|||||||
curl -sSL https://get.docker.com | sh
|
curl -sSL https://get.docker.com | sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if running in Proxmox LXC container and set endpoint mode
|
||||||
|
endpoint_mode=""
|
||||||
|
if is_proxmox_lxc; then
|
||||||
|
echo "⚠️ WARNING: Detected Proxmox LXC container environment!"
|
||||||
|
echo "Adding --endpoint-mode dnsrr to Docker service for LXC compatibility."
|
||||||
|
echo "This may affect service discovery but is required for LXC containers."
|
||||||
|
echo ""
|
||||||
|
endpoint_mode="--endpoint-mode dnsrr"
|
||||||
|
echo "Waiting for 5 seconds before continuing..."
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
docker swarm leave --force 2>/dev/null
|
docker swarm leave --force 2>/dev/null
|
||||||
|
|
||||||
get_ip() {
|
get_ip() {
|
||||||
@@ -145,6 +174,7 @@ install_dokploy() {
|
|||||||
--update-parallelism 1 \
|
--update-parallelism 1 \
|
||||||
--update-order stop-first \
|
--update-order stop-first \
|
||||||
--constraint 'node.role == manager' \
|
--constraint 'node.role == manager' \
|
||||||
|
$endpoint_mode \
|
||||||
-e ADVERTISE_ADDR=$advertise_addr \
|
-e ADVERTISE_ADDR=$advertise_addr \
|
||||||
dokploy/dokploy:latest
|
dokploy/dokploy:latest
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user