Skip to content

Commit

Permalink
feature/copy-folders (#2)
Browse files Browse the repository at this point in the history
* feature/copy-folders

---------

Co-authored-by: Bill Wang <[email protected]>
  • Loading branch information
ozbillwang and Bill Wang authored Oct 24, 2024
1 parent 62e0542 commit de496b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/build_ollama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ jobs:
pull-requests: write

steps:
- name: Set up Docker
run: |
# Build the Docker image
mkdir -p amd64 arm64
for arch in amd64 arm64; do
docker run -d --platform linux/${arch} --name ollama ollama/ollama
docker cp ollama:/usr/lib/ollama/runners/cpu ./${arch}/cpu
docker cp ollama:/usr/lib/ollama/runners/cpu_avx ./${arch}/cpu_avx || echo "ok"
docker cp ollama:/usr/lib/ollama/runners/cpu_avx2 ./${arch}/cpu_avx2 || echo "ok"
docker rm -f ollama
done
echo "list amd64 files"
find amd64 -ls
echo "list arm64 files"
find arm64 -ls
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
amd64/
arm64/
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ FROM ollama/ollama AS ollama

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/runners/cpu /usr/lib/ollama/runners/cpu

# COPY --from=ollama /usr/lib/ollama/runners/cpu /usr/lib/ollama/runners/cpu
# 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
# COPY --from=ollama /usr/lib/ollama/runners/cpu_avx2 /usr/lib/ollama/runners/cpu_avx2

COPY ./${TARGETARCH}/ /usr/lib/ollama/runners/

# Environment variable setup
ENV OLLAMA_HOST=0.0.0.0

Expand Down

0 comments on commit de496b0

Please sign in to comment.