fix(docker): Fix build arm image bug (#2446)

# Description

Fix build arm image bug

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

# Snapshots:

Include snapshots for easier review.

# Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have already rebased the commits and make the commit message
conform to the project standard.
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] Any dependent changes have been merged and published in downstream
modules
This commit is contained in:
magic.chen 2025-03-12 01:43:50 -03:00 committed by GitHub
commit 130efe3790
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View File

@ -43,6 +43,7 @@ jobs:
build-args: |
BASE_IMAGE=ubuntu:22.04
EXTRAS=base,proxy_openai,rag,graph_rag,storage_chromadb,dbgpts,proxy_ollama,proxy_zhipuai,proxy_anthropic,proxy_qianfan,proxy_tongyi
platforms: linux/amd64,linux/arm64,linux/arm/v7
PIP_INDEX_URL=https://pypi.org/simple
platforms: linux/arm64,linux/amd64
push: true
tags: eosphorosai/dbgpt-openai:${{ github.ref_name }},eosphorosai/dbgpt-openai:latest

View File

@ -40,6 +40,8 @@ jobs:
with:
context: .
file: ./docker/base/Dockerfile
build-args: |
PIP_INDEX_URL=https://pypi.org/simple
platforms: linux/amd64
push: true
tags: eosphorosai/dbgpt:${{ github.ref_name }},eosphorosai/dbgpt:latest

View File

@ -7,6 +7,7 @@ ARG BASE_IMAGE
ARG PYTHON_VERSION=3.11
# Use Tsinghua PyPI mirror, It's faster in most countries
ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
ARG UV_HTTP_TIMEOUT=180
ARG EXTRAS="base,proxy_openai,rag,storage_chromadb,cuda121,hf,quant_bnb,dbgpts"
ARG VERSION=latest
ARG USE_TSINGHUA_UBUNTU
@ -16,6 +17,7 @@ ENV PYTHONUNBUFFERED=1 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PIP_INDEX_URL=${PIP_INDEX_URL} \
UV_HTTP_TIMEOUT=${UV_HTTP_TIMEOUT} \
CMAKE_ARGS=${CMAKE_ARGS}
# Configure apt sources based on the USE_TSINGHUA_UBUNTU parameter
@ -31,8 +33,6 @@ RUN if [ "$USE_TSINGHUA_UBUNTU" = "true" ]; then \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv \
python3-pip \
python3-dev \
python3-virtualenv \
git \
curl \
wget \
@ -63,7 +63,9 @@ COPY packages /app/packages
# Install dependencies with uv and install all local packages
RUN --mount=type=cache,target=/root/.cache/uv \
extras=$(echo $EXTRAS | tr ',' '\n' | while read extra; do echo "--extra $extra"; done | tr '\n' ' ') && \
uv sync --frozen --all-packages --no-dev $extras && \
uv sync --frozen --all-packages \
--no-dev $extras \
--index-url=$PIP_INDEX_URL && \
# Verify installation
python -c "import dbgpt; print(dbgpt.__version__)"
ARG LANGUAGE="en"