Skip to content

fix: support macOS installation and add swarm init guidance#140

Open
cheonkyu wants to merge 2 commits intoDokploy:mainfrom
cheonkyu:fix/mac-install-script
Open

fix: support macOS installation and add swarm init guidance#140
cheonkyu wants to merge 2 commits intoDokploy:mainfrom
cheonkyu:fix/mac-install-script

Conversation

@cheonkyu
Copy link

@cheonkyu cheonkyu commented Feb 23, 2026

Description:
This PR introduces support for macOS (Docker Desktop) to the installation script. Currently, the script is restricted to Linux, but many developers use macOS for testing and local development.

Key Improvements:

  • OS Compatibility: Added IS_MAC detection to bypass Linux-only root checks.
  • Port Checking: Replaced Linux-specific ss command with a portable check_port helper using lsof.
  • User Guidance: Added a helpful tip to manually set ADVERTISE_ADDR=127.0.0.1 if Swarm initialization fails on Mac.

Related Issue: dokploy/dokploy#2409

Greptile Summary

This PR adds macOS support to the Dokploy installation script by introducing OS detection, replacing Linux-specific commands with portable alternatives, and adding helpful guidance for Docker Swarm initialization issues.

Key changes:

  • Added IS_MAC detection to identify macOS environments
  • Replaced ss command with portable check_port() helper that uses lsof on macOS
  • Added macOS-specific error guidance for Docker Swarm initialization failures
  • Refactored port checking to use a loop instead of repeated code
  • Made the script executable (file mode change)

Issues found:

  • The osascript command for getting the private IP uses invalid AppleScript syntax and will always fail, falling back to 127.0.0.1
  • Root permission check still applies to macOS users, but Docker Desktop doesn't require root for most operations
  • Error message at line 110 still says "must be run on Linux" despite adding macOS support

Confidence Score: 3/5

  • This PR has good intentions but contains a critical bug that prevents the main feature from working correctly
  • The PR makes sensible architectural changes (portable port checking, OS detection, helpful user guidance), but the core macOS IP detection feature is broken due to invalid AppleScript syntax. The script will still run due to the fallback, but it will always use 127.0.0.1 on macOS instead of detecting the actual private IP, which defeats part of the purpose of the PR. The other issues are minor (misleading error messages, unnecessary root check).
  • The get_private_ip() function at line 193 requires immediate attention to fix the broken osascript command

Last reviewed commit: d98717a

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 3 comments

Edit Code Review Agent Settings | Greptile


# check if is running inside a container
if [ -f /.dockerenv ]; then
echo "This script must be run on Linux" >&2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message says "must be run on Linux" but script now supports macOS - update message to say "cannot be run inside a container" or similar

@greptile-apps
Copy link

greptile-apps bot commented Feb 23, 2026

Additional Comments (1)

apps/website/public/install.sh
the root check still applies to macOS, but on macOS with Docker Desktop, users don't typically need root for Docker operations - consider skipping root check when IS_MAC=true

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant