Files
ComfyUI-ARM64-Docker/comfyui-rocm-dockerfile
T
derek 640d2a7345
Docker Build and Release Upload / build-vulkan (push) Failing after 2m2s
Docker Build and Release Upload / build-uvicorn (push) Canceled after 0s
Docker Build and Release Upload / build-cuda (push) Canceled after 53s
This is really Ollama but bear with me
2026-09-09 15:29:20 -07:00

48 lines
1.2 KiB
Plaintext

# Stage 1: Build Ollama with Vulkan support for ARM64/AMD64
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
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 .
# Configure and build using CMake for Vulkan backend support
RUN cmake -B build -D CMAKE_BUILD_TYPE=Release -D OLLAMA_LLAMA_BACKENDS="vulkan"
RUN cmake --build build --parallel $(nproc)
# Build the final Go binary
RUN go build -o ollama .
# Stage 2: Minimal Runtime Image
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
libvulkan1 \
mesa-vulkan-drivers \
vulkan-tools \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the compiled binary from the builder stage
COPY --from=builder /app/ollama /usr/local/bin/ollama
# Copy built backend libraries if generated under build output
COPY --from=builder /app/build/lib/ollama /usr/local/lib/ollama
EXPOSE 11434
ENV OLLAMA_HOST=0.0.0.0:11434
ENV OLLAMA_MODELS=/root/.ollama/models
ENTRYPOINT ["ollama", "serve"]