Try new docker build
This commit is contained in:
1 parent
9a0e407107
commit
70976e1d51
1 file changed
+31
-27
+31
-27
@@ -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"]
|
||||
ENTRYPOINT ["ollama", "serve"]
|
||||
Reference in new issue
Block a user