fix: make install.sh POSIX-compatible so curl | sh works on dash

The docs instruct 'curl -sSL https://dokploy.com/install.sh | sh', but on
Debian/Ubuntu sh is dash, which has no [[ or =~. The RELEASE_TAG detection
failed with 'sh: 264: [[: not found' and, since the script does not run
with set -e, silently fell through to the elif branch, so stable installs
via sh got RELEASE_TAG=<version> instead of RELEASE_TAG=latest.

Replace the bash-only test with a POSIX case statement. Verified end-to-end
on Ubuntu 20.04/24.04 and Debian 12 (dash), Alpine 3.20 (busybox ash), and
Rocky 9 / Fedora 41 (bash as sh), including the canary, latest and update
code paths. Both '| sh' and '| bash' now work.

Fixes #157
This commit is contained in:
Mauricio Siu
2026-07-07 09:44:14 -06:00
parent 23ba5f63ac
commit 43cc267a9f

View File

@@ -291,14 +291,21 @@ install_dokploy() {
# Installation
# Set RELEASE_TAG environment variable for canary/feature versions
# POSIX-compatible (no [[ ]]): the script is documented as `curl ... | sh`,
# and on Debian/Ubuntu sh is dash, which has no [[ or =~ (issue #157)
release_tag_env=""
if [[ "$VERSION_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
# Specific version (v0.26.6, v0.26.7, etc.) → latest
release_tag_env="-e RELEASE_TAG=latest"
elif [ "$VERSION_TAG" != "latest" ]; then
# canary, feature/*, etc. → use the tag as-is
release_tag_env="-e RELEASE_TAG=$VERSION_TAG"
fi
case "$VERSION_TAG" in
v[0-9]*.[0-9]*.[0-9]*)
# Specific version (v0.26.6, v0.26.7, etc.) → latest
release_tag_env="-e RELEASE_TAG=latest"
;;
latest)
;;
*)
# canary, feature/*, etc. → use the tag as-is
release_tag_env="-e RELEASE_TAG=$VERSION_TAG"
;;
esac
docker service create \
--name dokploy \