From ea2058f424537c9004f9d8edb4950e37820c5972 Mon Sep 17 00:00:00 2001 From: danbao Date: Mon, 22 Dec 2025 00:37:39 +0800 Subject: [PATCH 1/4] refactor: migrate to parameterized Dockerfile with centralized config - Replace version-specific directories with single parameterized Dockerfiles - Add versions/versions.json as single source of truth - Update CI/CD workflow with dynamic matrix from versions.json - Support multi-platform builds (linux/amd64, linux/arm64) - Add pull_request trigger for testing without push - Separate build jobs for base and packages images --- .github/workflows/build-denali.yml | 118 ------------- .github/workflows/build.yml | 272 +++++++++++++++++++++++++++++ 3.11-bookworm/base/Dockerfile | 16 -- 3.11-bookworm/packages/Dockerfile | 19 -- 3.12-bookworm/base/Dockerfile | 16 -- 3.12-bookworm/packages/Dockerfile | 19 -- base/Dockerfile | 31 ++++ packages/Dockerfile | 41 +++++ versions/versions.json | 20 +++ 9 files changed, 364 insertions(+), 188 deletions(-) delete mode 100644 .github/workflows/build-denali.yml create mode 100644 .github/workflows/build.yml delete mode 100644 3.11-bookworm/base/Dockerfile delete mode 100644 3.11-bookworm/packages/Dockerfile delete mode 100644 3.12-bookworm/base/Dockerfile delete mode 100644 3.12-bookworm/packages/Dockerfile create mode 100644 base/Dockerfile create mode 100644 packages/Dockerfile create mode 100644 versions/versions.json diff --git a/.github/workflows/build-denali.yml b/.github/workflows/build-denali.yml deleted file mode 100644 index d10ed26..0000000 --- a/.github/workflows/build-denali.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Build Denali Images - -on: - push: - branches: - - main - paths: - - '*.*-*/*' - - '.github/workflows/build-denali.yml' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - os_version: [bookworm] - type: [base, packages] - python_version: [3.11, 3.12] - fail-fast: false - - steps: - - uses: actions/checkout@v4 - - - name: Docker login - env: - DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} - DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo $DOCKER_HUB_PASSWORD | docker login --username $DOCKER_HUB_USERNAME --password-stdin - echo $GITHUB_TOKEN | docker login ghcr.io --username $GITHUB_ACTOR --password-stdin - - - name: Set Environment Variables - id: vars - run: | - DOCKFILE_DIR=${{ matrix.python_version }}-${{ matrix.os_version }}/${{ matrix.type }} - if [[ -f ${DOCKFILE_DIR}/Dockerfile ]]; then - VERSION=${{ matrix.python_version }}-${{ matrix.os_version }}-${{ matrix.type }} - echo "${VERSION}" > ${DOCKFILE_DIR}/version.txt - else - VERSION=$(cat ${DOCKFILE_DIR}/version.txt) - fi - echo "DOCKFILE_DIR=${DOCKFILE_DIR}" >> $GITHUB_ENV - echo "VERSION=${VERSION}" >> $GITHUB_ENV - - - name: Build Docker Image - run: | - IMAGE_NAME=ringcentral/denali-${{ matrix.type }} - echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV - docker build --tag ${IMAGE_NAME} --file ${DOCKFILE_DIR}/Dockerfile . - - - name: Tag and Push Docker Images - run: | - IMAGE_NAME=ringcentral/denali-${{ matrix.type }} - GH_DOCKER_PKG_IMAGE_NAME=ghcr.io/ringcentral-docker/denali/denali-${{ matrix.type }} - - docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${VERSION}" - docker push "${IMAGE_NAME}:${VERSION}" - - docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}" - docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}" - - if [[ "${{ matrix.python_version }}" == "3.11" && "${{ matrix.os_version }}" == "bookworm" ]]; then - docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:latest" - docker push "${IMAGE_NAME}:latest" - docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:latest" - docker push "${GH_DOCKER_PKG_IMAGE_NAME}:latest" - fi - - - name: Generate README Update - run: | - IMAGE_NAME=ringcentral/denali-${{ matrix.type }} - GH_DOCKER_PKG_IMAGE_NAME=ghcr.io/ringcentral-docker/denali/denali-${{ matrix.type }} - - NEW_ENTRY="| Python ${{ matrix.python_version }} | ${{ matrix.os_version }} | ${{ matrix.type }} | ${VERSION} | \`${IMAGE_NAME}:${VERSION}\` | \`${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}\` |" - echo "${NEW_ENTRY}" > readme_updates_${VERSION}.txt - - - name: Upload README Update - uses: actions/upload-artifact@v4 - with: - name: readme-updates-${{ matrix.python_version }}-${{ matrix.os_version }}-${{ matrix.type }} - path: readme_updates_${VERSION}.txt - - update-readme: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Download ALL README Updates - uses: actions/download-artifact@v4 - with: - path: ./readme-updates - - - name: Initialize README - run: | - echo "| Python Version | OS Version | Type | Version | Docker Hub | GitHub Package |" > README.md - echo "|----------------|------------|------|---------|------------|----------------|" >> README.md - - - name: Update README - run: | - if [ -z "$(find ./readme-updates -type f -name '*.txt')" ]; then - echo "No updates found. Skipping README update." - exit 0 - fi - for file in ./readme-updates/*/*; do - cat "$file" >> README.md - done - - - name: Commit README Update - run: | - git config --global user.name 'john.lin' - git config --global user.email 'john.lin@ringcentral.com' - git add README.md - git commit -m "Update README with Docker image info" - git push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4754573 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,272 @@ +name: Build Denali Images + +on: + push: + branches: + - main + paths: + - 'base/**' + - 'packages/**' + - 'versions/**' + - '.github/workflows/build.yml' + pull_request: + paths: + - 'base/**' + - 'packages/**' + - 'versions/**' + - '.github/workflows/build.yml' + workflow_dispatch: + inputs: + version: + description: 'Specific version to build (e.g., 3.12-bookworm), or "all" for all versions' + required: false + default: 'all' + +env: + DOCKER_HUB_IMAGE_BASE: ringcentral/denali-base + DOCKER_HUB_IMAGE_PACKAGES: ringcentral/denali-packages + GHCR_IMAGE_BASE: ghcr.io/ringcentral-docker/denali-base + GHCR_IMAGE_PACKAGES: ghcr.io/ringcentral-docker/denali-packages + +jobs: + # ============================================================================= + # Generate build matrix from versions.json + # ============================================================================= + prepare: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - name: Generate build matrix + id: set-matrix + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.version }}" != "all" ]]; then + MATRIX=$(jq -c --arg v "${{ github.event.inputs.version }}" \ + '{include: [.versions[] | select(.name == $v)]}' versions/versions.json) + else + MATRIX=$(jq -c '{include: .versions}' versions/versions.json) + fi + echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT + + # ============================================================================= + # Build base images + # ============================================================================= + build-base: + needs: prepare + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + fail-fast: false + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate Docker tags + id: meta + run: | + NAME="${{ matrix.name }}" + IS_LATEST="${{ matrix.is_latest }}" + + TAGS="" + for REGISTRY in "${{ env.DOCKER_HUB_IMAGE_BASE }}" "${{ env.GHCR_IMAGE_BASE }}"; do + TAGS="${TAGS}${REGISTRY}:${NAME}," + if [[ "${IS_LATEST}" == "true" ]]; then + TAGS="${TAGS}${REGISTRY}:latest," + fi + done + + echo "tags=${TAGS%,}" >> $GITHUB_OUTPUT + + - name: Build and push base image + uses: docker/build-push-action@v6 + with: + context: . + file: ./base/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + BASE_IMAGE_TAG=${{ matrix.base_image_tag }} + cache-from: type=gha,scope=base-${{ matrix.name }} + cache-to: type=gha,mode=max,scope=base-${{ matrix.name }} + + # ============================================================================= + # Build packages images + # ============================================================================= + build-packages: + needs: prepare + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + fail-fast: false + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate Docker tags + id: meta + run: | + NAME="${{ matrix.name }}" + IS_LATEST="${{ matrix.is_latest }}" + + TAGS="" + for REGISTRY in "${{ env.DOCKER_HUB_IMAGE_PACKAGES }}" "${{ env.GHCR_IMAGE_PACKAGES }}"; do + TAGS="${TAGS}${REGISTRY}:${NAME}," + if [[ "${IS_LATEST}" == "true" ]]; then + TAGS="${TAGS}${REGISTRY}:latest," + fi + done + + echo "tags=${TAGS%,}" >> $GITHUB_OUTPUT + + - name: Build and push packages image + uses: docker/build-push-action@v6 + with: + context: . + file: ./packages/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + BASE_IMAGE_TAG=${{ matrix.base_image_tag }} + POETRY_VERSION=${{ matrix.poetry_version }} + cache-from: type=gha,scope=packages-${{ matrix.name }} + cache-to: type=gha,mode=max,scope=packages-${{ matrix.name }} + + # ============================================================================= + # Update README + # ============================================================================= + update-readme: + needs: [build-base, build-packages] + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Generate README from versions.json + run: | + cat > README.md << 'HEADER' + # Denali Docker Images + + Multi-platform Python Docker images for Denali projects. + + ## Supported Platforms + + - linux/amd64 + - linux/arm64 + + ## Base Images (denali-base) + + | Python | OS | Docker Hub | GitHub Package | + |--------|-------|------------|----------------| + HEADER + + # Generate base image rows + jq -r --arg hub "${{ env.DOCKER_HUB_IMAGE_BASE }}" \ + --arg ghcr "${{ env.GHCR_IMAGE_BASE }}" \ + '.versions[] | + "| \(.python_version) | \(.os_version) | `\($hub):\(.name)` | `\($ghcr):\(.name)` |" + ' versions/versions.json >> README.md + + cat >> README.md << 'MIDDLE' + + ## Packages Images (denali-packages) + + | Python | OS | Poetry | Docker Hub | GitHub Package | + |--------|-------|--------|------------|----------------| + MIDDLE + + # Generate packages image rows + jq -r --arg hub "${{ env.DOCKER_HUB_IMAGE_PACKAGES }}" \ + --arg ghcr "${{ env.GHCR_IMAGE_PACKAGES }}" \ + '.versions[] | + "| \(.python_version) | \(.os_version) | \(.poetry_version) | `\($hub):\(.name)` | `\($ghcr):\(.name)` |" + ' versions/versions.json >> README.md + + cat >> README.md << 'FOOTER' + + ## Usage + + ```bash + # Pull base image + docker pull ringcentral/denali-base:3.11-bookworm + + # Pull packages image (with Poetry) + docker pull ringcentral/denali-packages:3.11-bookworm + ``` + + ## Build Locally + + ```bash + # Build base image + docker build --build-arg BASE_IMAGE_TAG=3.12-bookworm \ + -f base/Dockerfile -t denali-base:3.12-bookworm . + + # Build packages image + docker build --build-arg BASE_IMAGE_TAG=3.12-bookworm \ + --build-arg POETRY_VERSION=2.0.1 \ + -f packages/Dockerfile -t denali-packages:3.12-bookworm . + ``` + + ## License + + MIT License + FOOTER + + - name: Commit README + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add README.md + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "docs: update README with Docker image info" + git push + fi diff --git a/3.11-bookworm/base/Dockerfile b/3.11-bookworm/base/Dockerfile deleted file mode 100644 index e01ea20..0000000 --- a/3.11-bookworm/base/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# base image -FROM public.ecr.aws/docker/library/python:3.11-bookworm - -RUN apt-get update \ - # Install dependencies - && apt-get install -y --no-install-recommends \ - # basic environment - curl nodejs libgmp-dev libmpfr-dev libmpc-dev \ - # For Security - expat libldap-2.5-0 perl libsqlite3-0 zlib1g \ - # install a chinese font to support the use of tools like matplotlib - fonts-noto-cjk \ - # install libmagic to support the use of python-magic guess MIMETYPE - libmagic1 \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/3.11-bookworm/packages/Dockerfile b/3.11-bookworm/packages/Dockerfile deleted file mode 100644 index 7183ff1..0000000 --- a/3.11-bookworm/packages/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# base image -FROM public.ecr.aws/docker/library/python:3.11-bookworm AS base - -WORKDIR /app/api - -# Install Poetry -ENV POETRY_VERSION=2.0.1 - -RUN pip install --no-cache-dir poetry==${POETRY_VERSION} - -# Configure Poetry -ENV POETRY_CACHE_DIR=/tmp/poetry_cache -ENV POETRY_NO_INTERACTION=1 -ENV POETRY_VIRTUALENVS_IN_PROJECT=true -ENV POETRY_VIRTUALENVS_CREATE=true -ENV POETRY_REQUESTS_TIMEOUT=15 - -RUN apt-get update \ - && apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev diff --git a/3.12-bookworm/base/Dockerfile b/3.12-bookworm/base/Dockerfile deleted file mode 100644 index d6e2273..0000000 --- a/3.12-bookworm/base/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# base image -FROM public.ecr.aws/docker/library/python:3.12-bookworm - -RUN apt-get update \ - # Install dependencies - && apt-get install -y --no-install-recommends \ - # basic environment - curl nodejs libgmp-dev libmpfr-dev libmpc-dev \ - # For Security - expat libldap-2.5-0 perl libsqlite3-0 zlib1g \ - # install a chinese font to support the use of tools like matplotlib - fonts-noto-cjk \ - # install libmagic to support the use of python-magic guess MIMETYPE - libmagic1 \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/3.12-bookworm/packages/Dockerfile b/3.12-bookworm/packages/Dockerfile deleted file mode 100644 index 0952e9c..0000000 --- a/3.12-bookworm/packages/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# base image -FROM public.ecr.aws/docker/library/python:3.12-bookworm - -WORKDIR /app/api - -# Install Poetry -ENV POETRY_VERSION=2.0.1 - -RUN pip install --no-cache-dir poetry==${POETRY_VERSION} - -# Configure Poetry -ENV POETRY_CACHE_DIR=/tmp/poetry_cache -ENV POETRY_NO_INTERACTION=1 -ENV POETRY_VIRTUALENVS_IN_PROJECT=true -ENV POETRY_VIRTUALENVS_CREATE=true -ENV POETRY_REQUESTS_TIMEOUT=15 - -RUN apt-get update \ - && apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev diff --git a/base/Dockerfile b/base/Dockerfile new file mode 100644 index 0000000..1784a89 --- /dev/null +++ b/base/Dockerfile @@ -0,0 +1,31 @@ +# Parameterized Denali Base Dockerfile +# +# Build example: +# docker build --build-arg BASE_IMAGE_TAG=3.12-bookworm -t ringcentral/denali-base:3.12-bookworm . + +ARG BASE_IMAGE_TAG=3.11-bookworm + +FROM public.ecr.aws/docker/library/python:${BASE_IMAGE_TAG} + +LABEL maintainer="john.lin@ringcentral.com" + +RUN apt-get update \ + # Install dependencies + && apt-get install -y --no-install-recommends \ + # basic environment + curl nodejs libgmp-dev libmpfr-dev libmpc-dev \ + # For Security + expat libldap-2.5-0 perl libsqlite3-0 zlib1g \ + # install a chinese font to support the use of tools like matplotlib + fonts-noto-cjk \ + # install libmagic to support the use of python-magic guess MIMETYPE + libmagic1 \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +# Verify installation +RUN echo "=== Version Summary ===" \ + && python --version \ + && pip --version \ + && node --version \ + && curl --version | head -1 diff --git a/packages/Dockerfile b/packages/Dockerfile new file mode 100644 index 0000000..3c018ae --- /dev/null +++ b/packages/Dockerfile @@ -0,0 +1,41 @@ +# Parameterized Denali Packages Dockerfile +# +# Build example: +# docker build \ +# --build-arg BASE_IMAGE_TAG=3.12-bookworm \ +# --build-arg POETRY_VERSION=2.0.1 \ +# -t ringcentral/denali-packages:3.12-bookworm . + +ARG BASE_IMAGE_TAG=3.11-bookworm + +FROM public.ecr.aws/docker/library/python:${BASE_IMAGE_TAG} + +LABEL maintainer="john.lin@ringcentral.com" + +ARG POETRY_VERSION=2.0.1 + +WORKDIR /app/api + +# Install Poetry +ENV POETRY_VERSION=${POETRY_VERSION} +RUN pip install --no-cache-dir poetry==${POETRY_VERSION} + +# Configure Poetry +ENV POETRY_CACHE_DIR=/tmp/poetry_cache \ + POETRY_NO_INTERACTION=1 \ + POETRY_VIRTUALENVS_IN_PROJECT=true \ + POETRY_VIRTUALENVS_CREATE=true \ + POETRY_REQUESTS_TIMEOUT=15 + +# Install build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +# Verify installation +RUN echo "=== Version Summary ===" \ + && python --version \ + && pip --version \ + && poetry --version diff --git a/versions/versions.json b/versions/versions.json new file mode 100644 index 0000000..5ad1002 --- /dev/null +++ b/versions/versions.json @@ -0,0 +1,20 @@ +{ + "versions": [ + { + "name": "3.11-bookworm", + "python_version": "3.11", + "os_version": "bookworm", + "base_image_tag": "3.11-bookworm", + "poetry_version": "2.0.1", + "is_latest": true + }, + { + "name": "3.12-bookworm", + "python_version": "3.12", + "os_version": "bookworm", + "base_image_tag": "3.12-bookworm", + "poetry_version": "2.0.1", + "is_latest": false + } + ] +} From e4cce84062988a86c75182a803be6e0702a4233c Mon Sep 17 00:00:00 2001 From: danbao Date: Mon, 22 Dec 2025 00:42:06 +0800 Subject: [PATCH 2/4] Update versions.json to add Python 3.13 and 3.14 versions with corresponding base image tags and poetry versions --- versions/versions.json | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/versions/versions.json b/versions/versions.json index 5ad1002..0f49453 100644 --- a/versions/versions.json +++ b/versions/versions.json @@ -1,20 +1,36 @@ { "versions": [ { - "name": "3.11-bookworm", - "python_version": "3.11", + "name": "3.13-bookworm", + "python_version": "3.13", "os_version": "bookworm", - "base_image_tag": "3.11-bookworm", - "poetry_version": "2.0.1", - "is_latest": true + "base_image_tag": "3.13-bookworm", + "poetry_version": "2.2.1", + "is_latest": false + }, + { + "name": "3.13-trixie", + "python_version": "3.13", + "os_version": "trixie", + "base_image_tag": "3.13-trixie", + "poetry_version": "2.2.1", + "is_latest": false }, { - "name": "3.12-bookworm", - "python_version": "3.12", + "name": "3.14-bookworm", + "python_version": "3.14", "os_version": "bookworm", - "base_image_tag": "3.12-bookworm", - "poetry_version": "2.0.1", + "base_image_tag": "3.14-bookworm", + "poetry_version": "2.2.1", "is_latest": false + }, + { + "name": "3.14-trixie", + "python_version": "3.14", + "os_version": "trixie", + "base_image_tag": "3.14-trixie", + "poetry_version": "2.2.1", + "is_latest": true } ] } From e8f835ed987d89b67e1befdc1e5377db8fda576d Mon Sep 17 00:00:00 2001 From: danbao Date: Mon, 22 Dec 2025 00:45:25 +0800 Subject: [PATCH 3/4] fix: handle libldap package name variations across Debian versions --- base/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 1784a89..c1d4a8e 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -15,11 +15,15 @@ RUN apt-get update \ # basic environment curl nodejs libgmp-dev libmpfr-dev libmpc-dev \ # For Security - expat libldap-2.5-0 perl libsqlite3-0 zlib1g \ + expat perl libsqlite3-0 zlib1g \ # install a chinese font to support the use of tools like matplotlib fonts-noto-cjk \ # install libmagic to support the use of python-magic guess MIMETYPE libmagic1 \ + # Install libldap (package name varies by Debian version) + && (apt-get install -y --no-install-recommends libldap-2.5-0 || \ + apt-get install -y --no-install-recommends libldap2 || \ + echo "libldap package not found, skipping") \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* From e95fb9fb401b205e398cfc2c95dcbdd88387ff4b Mon Sep 17 00:00:00 2001 From: danbao Date: Mon, 22 Dec 2025 00:45:25 +0800 Subject: [PATCH 4/4] fix: handle libldap package name variations across Debian versions --- base/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/base/Dockerfile b/base/Dockerfile index c1d4a8e..2e81d30 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update \ # install libmagic to support the use of python-magic guess MIMETYPE libmagic1 \ # Install libldap (package name varies by Debian version) + # TODO: Remove libldap-2.5-0 fallback when bookworm is deprecated, keep only libldap2 && (apt-get install -y --no-install-recommends libldap-2.5-0 || \ apt-get install -y --no-install-recommends libldap2 || \ echo "libldap package not found, skipping") \