This is really Ollama but bear with me
This commit is contained in:
1 parent
8e57fdd690
commit
640d2a7345
1 file changed
+11
-7
+11
-7
@@ -1,4 +1,4 @@
|
|||||||
# Stage 1: Build Ollama with Vulkan support for ARM64
|
# 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
|
||||||
@@ -16,10 +16,12 @@ RUN apt-get update && apt-get install -y \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN git clone --recursive https://github.com/ollama/ollama.git .
|
RUN git clone --recursive https://github.com/ollama/ollama.git .
|
||||||
|
|
||||||
# Build Ollama with Vulkan support enabled
|
# Configure and build using CMake for Vulkan backend support
|
||||||
ENV OLLAMA_SET_VULKAN=1
|
RUN cmake -B build -D CMAKE_BUILD_TYPE=Release -D OLLAMA_LLAMA_BACKENDS="vulkan"
|
||||||
RUN go generate ./... && \
|
RUN cmake --build build --parallel $(nproc)
|
||||||
go build -tags vulkan .
|
|
||||||
|
# Build the final Go binary
|
||||||
|
RUN go build -o ollama .
|
||||||
|
|
||||||
# Stage 2: Minimal Runtime Image
|
# Stage 2: Minimal Runtime Image
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
@@ -33,9 +35,11 @@ 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 compiled binaries from builder stage
|
# Copy the compiled binary from the builder stage
|
||||||
COPY --from=builder /app/ollama /usr/local/bin/ollama
|
COPY --from=builder /app/ollama /usr/local/bin/ollama
|
||||||
COPY --from=builder /app/dist /usr/local/bin/dist
|
|
||||||
|
# Copy built backend libraries if generated under build output
|
||||||
|
COPY --from=builder /app/build/lib/ollama /usr/local/lib/ollama
|
||||||
|
|
||||||
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