Skip to content

Commit 4fff4dc

Browse files
committed
Fix permission issue on legacy builds
1 parent 901f76d commit 4fff4dc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ RUN mkdir -p \
2121
# Also create a home directory for this user (-m), as some common Python tools
2222
# (such as uv) interact with the user’s home directory.
2323
RUN useradd -m comfyui
24-
USER comfyui
2524

26-
# Install ComfyUI under /comfyui.
25+
# Install ComfyUI under /comfyui and set folder ownership to the comfyui user.
26+
# With the legacy Docker builder (DOCKER_BUILDKIT=0), WORKDIR always creates missing
27+
# directories as root (even if a different USER is active). To ensure the comfyui user
28+
# can write inside, ownership must be fixed manually.
2729
WORKDIR /comfyui
30+
RUN chown comfyui:comfyui .
31+
32+
# Install ComfyUI as ComfyUI
33+
USER comfyui
2834

2935
# Set up a Python virtual environment and configure it as the default Python.
3036
#

0 commit comments

Comments
 (0)