From 4fff4dc0329e5678d6ccaa5b9cc6e69ec379884c Mon Sep 17 00:00:00 2001 From: "B. Bergeron" Date: Mon, 25 Aug 2025 22:56:35 -0400 Subject: [PATCH] Fix permission issue on legacy builds --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce43bfbac..11e1f6e01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,10 +21,16 @@ RUN mkdir -p \ # Also create a home directory for this user (-m), as some common Python tools # (such as uv) interact with the user’s home directory. RUN useradd -m comfyui -USER comfyui -# Install ComfyUI under /comfyui. +# Install ComfyUI under /comfyui and set folder ownership to the comfyui user. +# With the legacy Docker builder (DOCKER_BUILDKIT=0), WORKDIR always creates missing +# directories as root (even if a different USER is active). To ensure the comfyui user +# can write inside, ownership must be fixed manually. WORKDIR /comfyui +RUN chown comfyui:comfyui . + +# Install ComfyUI as ComfyUI +USER comfyui # Set up a Python virtual environment and configure it as the default Python. #