From 06913a0e3c294941518af502e670da65ee808868 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:52:59 +0000 Subject: [PATCH 1/4] Initial plan From 64b0b536ff3e3368d4acf6c1ac0ff1850d3ffef5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:57:44 +0000 Subject: [PATCH 2/4] Fix Docker installation for Mac, Windows, and Linux platforms Co-authored-by: samdark <47294+samdark@users.noreply.github.com> --- Makefile | 19 +++++++++++++++++-- docker/Dockerfile | 8 +++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0f71412a..091634ca 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,25 @@ endif include docker/.env -# Current user ID and group ID except MacOS where it conflicts with Docker abilities -ifeq ($(shell uname), Darwin) +# Current user ID and group ID with platform-specific handling +# Detect OS +UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown) + +# MacOS: Use fixed UIDs to avoid conflicts with existing groups +ifeq ($(UNAME_S),Darwin) + export UID=1000 + export GID=1000 +# Windows (Git Bash/MSYS/MinGW): Use fixed UIDs +else ifneq (,$(findstring MINGW,$(UNAME_S))) + export UID=1000 + export GID=1000 +else ifneq (,$(findstring MSYS,$(UNAME_S))) + export UID=1000 + export GID=1000 +else ifneq (,$(findstring CYGWIN,$(UNAME_S))) export UID=1000 export GID=1000 +# Linux (including WSL): Use current user's IDs else export UID=$(shell id -u) export GID=$(shell id -g) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3c4711d1..cdf6ab81 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,12 +36,14 @@ COPY --from=composer /composer /usr/bin/composer # Based on https://frankenphp.dev/docs/docker/#running-as-a-non-root-user RUN \ - groupadd --gid ${GROUP_ID} ${GROUP_NAME}; \ - useradd --gid ${GROUP_ID} --uid ${USER_ID} ${GROUP_NAME}; \ + # Create group if it doesn't exist \ + getent group ${GROUP_ID} || groupadd --gid ${GROUP_ID} ${GROUP_NAME}; \ + # Create user \ + useradd --gid ${GROUP_ID} --uid ${USER_ID} ${USER_NAME}; \ # Add additional capability to bind to port 80 and 443 \ setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \ # Give write access to /data/caddy and /config/caddy \ - chown -R ${USER_NAME}:${GROUP_NAME} /data/caddy && chown -R ${USER_NAME}:${GROUP_NAME} /config/caddy + chown -R ${USER_NAME}:${GROUP_ID} /data/caddy && chown -R ${USER_NAME}:${GROUP_ID} /config/caddy USER ${USER_NAME} # From 1de4499e16c4a8a91b5de7b5829e475a6103c71d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:59:15 +0000 Subject: [PATCH 3/4] Add explanatory comments for cross-platform compatibility Co-authored-by: samdark <47294+samdark@users.noreply.github.com> --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index cdf6ab81..45060108 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,13 +36,13 @@ COPY --from=composer /composer /usr/bin/composer # Based on https://frankenphp.dev/docs/docker/#running-as-a-non-root-user RUN \ - # Create group if it doesn't exist \ + # Create group if it doesn't exist (handles Mac GID 20 conflict) \ getent group ${GROUP_ID} || groupadd --gid ${GROUP_ID} ${GROUP_NAME}; \ # Create user \ useradd --gid ${GROUP_ID} --uid ${USER_ID} ${USER_NAME}; \ # Add additional capability to bind to port 80 and 443 \ setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \ - # Give write access to /data/caddy and /config/caddy \ + # Give write access to /data/caddy and /config/caddy (using GID for cross-platform compatibility) \ chown -R ${USER_NAME}:${GROUP_ID} /data/caddy && chown -R ${USER_NAME}:${GROUP_ID} /config/caddy USER ${USER_NAME} From d3096d29d8eb7bd9b2d128623050ddd2d39df239 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 22:14:56 +0000 Subject: [PATCH 4/4] Add WSL detection for proper UID/GID handling on Windows Subsystem for Linux Co-authored-by: samdark <47294+samdark@users.noreply.github.com> --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f8e5a48c..c3226eb8 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,17 @@ include docker/.env # Current user ID and group ID with platform-specific handling # Detect OS UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown) +IS_WSL := $(shell grep -qi microsoft /proc/version 2>/dev/null && echo 1 || echo 0) # MacOS: Use fixed UIDs to avoid conflicts with existing groups ifeq ($(UNAME_S),Darwin) export UID=1000 export GID=1000 -# Windows (Git Bash/MSYS/MinGW): Use fixed UIDs +# WSL (Windows Subsystem for Linux): Use fixed UIDs +else ifeq ($(IS_WSL),1) + export UID=1000 + export GID=1000 +# Windows (Git Bash/MSYS/MinGW/Cygwin): Use fixed UIDs else ifneq (,$(findstring MINGW,$(UNAME_S))) export UID=1000 export GID=1000 @@ -26,7 +31,7 @@ else ifneq (,$(findstring MSYS,$(UNAME_S))) else ifneq (,$(findstring CYGWIN,$(UNAME_S))) export UID=1000 export GID=1000 -# Linux (including WSL): Use current user's IDs +# Linux (native): Use current user's IDs else export UID=$(shell id -u) export GID=$(shell id -g)