fix
This commit is contained in:
1 parent
c054188d45
commit
757d0784a0
1 file changed
+7
-4
@@ -1,4 +1,4 @@
|
|||||||
# Stage 1: Build Ollama with Vulkan support
|
# Stage 1: Build Ollama with Vulkan support for ARM64/AMD64
|
||||||
FROM ubuntu:24.04 AS builder
|
FROM ubuntu:24.04 AS builder
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
@@ -11,16 +11,19 @@ RUN apt-get update && apt-get install -y \
|
|||||||
golang-go \
|
golang-go \
|
||||||
libvulkan-dev \
|
libvulkan-dev \
|
||||||
vulkan-tools \
|
vulkan-tools \
|
||||||
|
glslang-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 .
|
RUN git clone --recursive https://github.com/ollama/ollama.git .
|
||||||
|
|
||||||
# Configure CMake explicitly for Vulkan backend compilation
|
# Configure CMake with explicit Vulkan backend parameter
|
||||||
RUN cmake -B build . -DOLLAMA_LLAMA_BACKENDS="vulkan"
|
RUN cmake -B build . -DOLLAMA_LLAMA_BACKENDS="vulkan"
|
||||||
|
|
||||||
|
# Compile target with parallel jobs
|
||||||
RUN cmake --build build --parallel $(nproc)
|
RUN cmake --build build --parallel $(nproc)
|
||||||
|
|
||||||
# Build the final Go binary
|
# 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
|
||||||
@@ -35,7 +38,7 @@ 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 the compiled binary and backend libraries from builder stage
|
# Copy binary and runtime libraries from builder
|
||||||
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/build/lib/ollama /usr/local/lib/ollama
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user