Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM docker.io/ollama/ollama:latest AS ollama

# Drop GPU backends (each lives in its own subdir) in a separate stage so the
# deleted bytes never end up in the final image's layers.
FROM ollama AS ollama-cpu-only
RUN rm -rf /usr/lib/ollama/cuda_v* /usr/lib/ollama/rocm_v* /usr/lib/ollama/vulkan /usr/lib/ollama/cuda_jetpack*

FROM cgr.dev/chainguard/wolfi-base

# ARG TARGETARCH

RUN apk add --no-cache libstdc++

COPY --from=ollama /usr/bin/ollama /usr/bin/ollama
COPY --from=ollama /usr/lib/ollama/libggml-cpu-* /usr/lib/ollama/
COPY --from=ollama /usr/lib/ollama/libggml-base.so /usr/lib/ollama/libggml-base.so
COPY --from=ollama-cpu-only /usr/bin/ollama /usr/bin/ollama
COPY --from=ollama-cpu-only /usr/lib/ollama /usr/lib/ollama

# In arm64 ollama/ollama image, there is no avx libraries and seems they are not must-have (#2903, #3891)
# COPY --from=ollama /usr/lib/ollama/runners/cpu_avx /usr/lib/ollama/runners/cpu_avx
Expand Down