From 70976e1d512b5bb8a202878623d1ff42529d8240 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Wed, 9 Sep 2026 15:02:29 -0700 Subject: [PATCH] Try new docker build --- comfyui-rocm-dockerfile | 58 ++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/comfyui-rocm-dockerfile b/comfyui-rocm-dockerfile index 4e28d6b..677d439 100644 --- a/comfyui-rocm-dockerfile +++ b/comfyui-rocm-dockerfile @@ -1,40 +1,44 @@ -# Use the official ROCm base image -FROM ubuntu:26.04 +# Stage 1: Build Ollama with Vulkan support for ARM64 +FROM ubuntu:24.04 AS builder -# Set environment variables for 7900 XTX (gfx1100) -ENV PIP_BREAK_SYSTEM_PACKAGES=1 -ENV PYTHONUNBUFFERED=1 +ENV DEBIAN_FRONTEND=noninteractive -RUN apt update -y && apt install -y --no-install-recommends \ - rocm \ - python3-pip \ - python3-dev \ - python3-torch-rocm \ - python3-torchaudio \ +RUN apt-get update && apt-get install -y \ + build-essential \ + cmake \ git \ - libgl1 \ - libglib2.0-bin \ + curl \ + golang-go \ + libvulkan-dev \ + vulkan-tools \ && rm -rf /var/lib/apt/lists/* WORKDIR /app +RUN git clone --recursive https://github.com/ollama/ollama.git . -# Clone ComfyUI -RUN git clone https://github.com/comfyanonymous/ComfyUI.git . +# Build Ollama with Vulkan support enabled +ENV OLLAMA_SET_VULKAN=1 +RUN go generate ./... && \ + go build -tags vulkan . -# Create sub dependancy -RUN grep -vE 'torch|nvidia|cuda|triton|kornia|spandrel' requirements.txt > req_no_torch.txt +# Stage 2: Minimal Runtime Image +FROM ubuntu:24.04 -# Install non torch dependant requirements -RUN pip3 install --no-cache-dir --break-system-packages -r req_no_torch.txt +ENV DEBIAN_FRONTEND=noninteractive -# Manually install the sensitive ones with --no-deps -RUN pip3 install --no-deps --break-system-packages torchsde kornia spandrel +RUN apt-get update && apt-get install -y \ + libvulkan1 \ + mesa-vulkan-drivers \ + vulkan-tools \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* -# Setup Manager -WORKDIR /app/custom_nodes -RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git +# Copy compiled binaries from builder stage +COPY --from=builder /app/ollama /usr/local/bin/ollama +COPY --from=builder /app/dist /usr/local/bin/dist -WORKDIR /app -EXPOSE 8188 +EXPOSE 11434 +ENV OLLAMA_HOST=0.0.0.0:11434 +ENV OLLAMA_MODELS=/root/.ollama/models -CMD ["python3", "main.py", "--listen", "0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["ollama", "serve"] \ No newline at end of file