Try new docker build
Docker Build and Release Upload / build-cuda (push) Failing after 4s
Docker Build and Release Upload / build-rocm (push) Successful in 2s
Docker Build and Release Upload / build-uvicorn (push) Canceled after 0s

This commit is contained in:
derek committed 2026-09-09 15:02:29 -07:00
1 parent 9a0e407107
commit 70976e1d51
1 file changed
+31 -27
+31 -27
View File
@@ -1,40 +1,44 @@
# Use the official ROCm base image # Stage 1: Build Ollama with Vulkan support for ARM64
FROM ubuntu:26.04 FROM ubuntu:24.04 AS builder
# Set environment variables for 7900 XTX (gfx1100) ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_BREAK_SYSTEM_PACKAGES=1
ENV PYTHONUNBUFFERED=1
RUN apt update -y && apt install -y --no-install-recommends \ RUN apt-get update && apt-get install -y \
rocm \ build-essential \
python3-pip \ cmake \
python3-dev \
python3-torch-rocm \
python3-torchaudio \
git \ git \
libgl1 \ curl \
libglib2.0-bin \ golang-go \
libvulkan-dev \
vulkan-tools \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
RUN git clone --recursive https://github.com/ollama/ollama.git .
# Clone ComfyUI # Build Ollama with Vulkan support enabled
RUN git clone https://github.com/comfyanonymous/ComfyUI.git . ENV OLLAMA_SET_VULKAN=1
RUN go generate ./... && \
go build -tags vulkan .
# Create sub dependancy # Stage 2: Minimal Runtime Image
RUN grep -vE 'torch|nvidia|cuda|triton|kornia|spandrel' requirements.txt > req_no_torch.txt FROM ubuntu:24.04
# Install non torch dependant requirements ENV DEBIAN_FRONTEND=noninteractive
RUN pip3 install --no-cache-dir --break-system-packages -r req_no_torch.txt
# Manually install the sensitive ones with --no-deps RUN apt-get update && apt-get install -y \
RUN pip3 install --no-deps --break-system-packages torchsde kornia spandrel libvulkan1 \
mesa-vulkan-drivers \
vulkan-tools \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Setup Manager # Copy compiled binaries from builder stage
WORKDIR /app/custom_nodes COPY --from=builder /app/ollama /usr/local/bin/ollama
RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git COPY --from=builder /app/dist /usr/local/bin/dist
WORKDIR /app EXPOSE 11434
EXPOSE 8188 ENV OLLAMA_HOST=0.0.0.0:11434
ENV OLLAMA_MODELS=/root/.ollama/models
CMD ["python3", "main.py", "--listen", "0.0.0.0"] ENTRYPOINT ["ollama", "serve"]