fix: Add python-is-python3 package and upgrade pip in GPU base image #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Docker Image to GHCR | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - release/* | |
| workflow_dispatch: | |
| jobs: | |
| build-and-push: | |
| name: Build and Push Docker Images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set image tags | |
| id: meta | |
| run: | | |
| BRANCH_NAME=${GITHUB_REF##*/} | |
| echo "branch_tag=${BRANCH_NAME//\//-}" >> "$GITHUB_OUTPUT" | |
| # 1. QEMU setup for cross-platform emulation | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| # 2. Buildx setup (ensures we have a multi-arch builder) | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| install: true | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # 3. Multi-arch GPU image | |
| - name: Build and push GPU Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile.pb | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository }}:latest-gpu | |
| ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.branch_tag }}-gpu | |
| build-args: | | |
| BUILD_TYPE=gpu | |
| PY_VER=3.10 | |
| TF_VER=2.9.2 | |
| CUDA_TAG=11.8.0-cudnn8-runtime-ubuntu22.04 | |
| # 4. Multi-arch CPU image | |
| - name: Build and push CPU Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile.pb | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository }}:latest-cpu | |
| ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.branch_tag }}-cpu | |
| build-args: | | |
| BUILD_TYPE=cpu | |
| PY_VER=3.10 | |
| TF_VER=2.9.2 |