Skip to content

Readme has incorrect volume mounts (overlapping /root) #149

@sammcj

Description

@sammcj

The first mount (storage:/root) maps everything, including paths like /root/ComfyUI/models

Docker's overlay2 already uses a layered filesystem (lowerdir + upperdir merged via overlayfs). When you add bind mounts on top:

  • Double indirection: You've got overlayfs presenting a merged view, then bind mounts punching holes through it. The kernel has to resolve paths through multiple filesystem layers, which can cause subtle bugs and performance overhead.
  • Inode/device ID mismatches: Files in the overlay have different device IDs than files in bind mounts. Applications that traverse directories or compare files by device+inode (like find, rsync, hardlink detection) can behave unexpectedly.
  • Opaque directories: Overlayfs uses special markers (trusted.overlay.opaque xattrs) to handle deleted directories. Bind mounts can interfere with this metadata, potentially causing "ghost" files or directories that should have been deleted.
  • Copy-up race conditions: When overlay2 needs to copy a file from lowerdir to upperdir for modification, but that path is also a bind mount target, you can hit race conditions or the copy-up happening to the wrong location.
  • fsync/flush ordering: Data integrity guarantees get murky. An fsync on a file in a bind mount nested inside overlay2 may not flush all layers as expected.
  • Namespace leakage: In edge cases with container restarts, you can end up with mount propagation issues where the nested mounts don't clean up properly, leaving dangling references.

For something like ComfyUI with large model files, the inode mismatch and copy-up issues are the most likely to bite you in practice.

  -v "$(pwd)"/storage:/root \         <--- This
  -v "$(pwd)"/storage-models/models:/root/ComfyUI/models \
  -v "$(pwd)"/storage-models/hf-hub:/root/.cache/huggingface/hub \
  -v "$(pwd)"/storage-models/torch-hub:/root/.cache/torch/hub \
  -v "$(pwd)"/storage-user/input:/root/ComfyUI/input \
  -v "$(pwd)"/storage-user/output:/root/ComfyUI/output \
  -v "$(pwd)"/storage-user/workflows:/root/ComfyUI/user/default/workflows \

You're also missing /root/ComfyUI/user and /root/ComfyUI/extra_model_paths.yaml

Suggest:

# Model storage (large, shared across containers)
-v "$(pwd)"/models/comfyui:/root/ComfyUI/models \
-v "$(pwd)"/models/huggingface:/root/.cache/huggingface/hub \
-v "$(pwd)"/models/torch:/root/.cache/torch/hub \

# User data (inputs, outputs, workflows, config)
-v "$(pwd)"/user/user:/root/ComfyUI/user \
-v "$(pwd)"/user/input:/root/ComfyUI/input \
-v "$(pwd)"/user/output:/root/ComfyUI/output \
-v "$(pwd)"/extra_model_paths.yaml:/root/ComfyUI/extra_model_paths.yaml \

# Custom nodes
-v "$(pwd)"/custom_nodes:/root/ComfyUI/custom_nodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions