asdf
This commit is contained in:
1 parent
757d0784a0
commit
60bd373bfd
1 file changed
+9
-9
@@ -1,4 +1,4 @@
|
|||||||
# Stage 1: Build Ollama with Vulkan support for ARM64/AMD64
|
# Stage 1: Build Ollama with Vulkan support
|
||||||
FROM ubuntu:24.04 AS builder
|
FROM ubuntu:24.04 AS builder
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
@@ -12,18 +12,18 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libvulkan-dev \
|
libvulkan-dev \
|
||||||
vulkan-tools \
|
vulkan-tools \
|
||||||
glslang-tools \
|
glslang-tools \
|
||||||
|
ninja-build \
|
||||||
&& 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 .
|
RUN git clone --recursive https://github.com/ollama/ollama.git .
|
||||||
|
|
||||||
# Configure CMake with explicit Vulkan backend parameter
|
# Use Ollama's official preset configuration for Vulkan compilation
|
||||||
RUN cmake -B build . -DOLLAMA_LLAMA_BACKENDS="vulkan"
|
RUN cmake -S llama/server --preset vulkan
|
||||||
|
RUN cmake --build build/llama-server-vulkan --parallel $(nproc)
|
||||||
|
RUN cmake --install build/llama-server-vulkan --component llama-server --prefix /app/dist
|
||||||
|
|
||||||
# Compile target with parallel jobs
|
# Build the main Go application binary
|
||||||
RUN cmake --build build --parallel $(nproc)
|
|
||||||
|
|
||||||
# Build the main Go executable
|
|
||||||
RUN go build -o ollama .
|
RUN go build -o ollama .
|
||||||
|
|
||||||
# Stage 2: Minimal Runtime Image
|
# Stage 2: Minimal Runtime Image
|
||||||
@@ -38,9 +38,9 @@ RUN apt-get update && apt-get install -y \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy binary and runtime libraries from builder
|
# Copy the compiled Go binary and the Vulkan backend runtime payload
|
||||||
COPY --from=builder /app/ollama /usr/local/bin/ollama
|
COPY --from=builder /app/ollama /usr/local/bin/ollama
|
||||||
COPY --from=builder /app/build/lib/ollama /usr/local/lib/ollama
|
COPY --from=builder /app/dist /usr/local
|
||||||
|
|
||||||
EXPOSE 11434
|
EXPOSE 11434
|
||||||
ENV OLLAMA_HOST=0.0.0.0:11434
|
ENV OLLAMA_HOST=0.0.0.0:11434
|
||||||
|
|||||||
Reference in new issue
Block a user