Optimize Docker build performance with parallel compilation

- Add -j$(nproc) flag to cmake build in ollama37.Dockerfile
- Use all available CPU cores for faster compilation
- Add sync-upstream.md documentation for future maintenance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Shang Chieh Tseng
2025-08-08 11:44:59 +08:00
parent 0cd81c838a
commit 83973336d6
2 changed files with 148 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ FROM dogkeeper886/ollama37-builder AS builder
COPY . /usr/local/src/ollama37
WORKDIR /usr/local/src/ollama37
RUN CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake -B build \
&& CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake --build build \
&& CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake --build build -j$(nproc) \
&& go build -o ollama .
# ===== Stage 2: Runtime image =====