Add ollama37 Dockerfile and docker compose file

This commit is contained in:
jack
2025-04-12 00:49:53 +08:00
parent 541f366111
commit 040143716e
2 changed files with 8 additions and 6 deletions

View File

@@ -12,14 +12,16 @@ RUN cd /usr/local/src \
# ===== Stage 2: Runtime image ===== # ===== Stage 2: Runtime image =====
FROM rockylinux/rockylinux:8 FROM rockylinux/rockylinux:8
RUN dnf -y update
# Copy only the built binary and any needed assets from the builder stage # Copy only the built binary and any needed assets from the builder stage
COPY --from=builder /usr/local/src/ollama37 /usr/local/src/ollama37 COPY --from=builder /usr/local/src/ollama37 /usr/local/src/ollama37
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/lib64 /usr/local/lib64 COPY --from=builder /usr/local/lib64 /usr/local/lib64
COPY --from=builder /usr/local/cuda-11.4/lib64 /usr/local/cuda-11.4/lib64
# Set environment variables # Set environment variables
ENV LD_LIBRARY_PATH="/usr/local/lib64" ENV LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/cuda-11.4/lib64"
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
ENV NVIDIA_VISIBLE_DEVICES=all ENV NVIDIA_VISIBLE_DEVICES=all
ENV OLLAMA_HOST=0.0.0.0:11434 ENV OLLAMA_HOST=0.0.0.0:11434

View File

@@ -7,9 +7,9 @@ services:
ports: ports:
- "11434:11434" - "11434:11434"
volumes: volumes:
- ollama:/root/.ollama - /home/jack/.ollama:/root/.ollama
restart: unless-stopped restart: unless-stopped
runtime: nvidia runtime: nvidia
volumes: #volumes:
ollama: #ollama: