Build Docker images 0.14 #169
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: Build Docker images | |
| run-name: Build Docker images ${{ inputs.image_version }}${{ inputs.staging && ' (staging)' || '' }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| image_version: | |
| description: "Image version" | |
| required: true | |
| staging: | |
| description: "Build staging images" | |
| type: boolean | |
| default: false | |
| env: | |
| BUILD_DOCKER_REPO: ${{ inputs.staging && 'base-stgn' || 'base' }} | |
| jobs: | |
| build-docker: | |
| defaults: | |
| run: | |
| working-directory: docker | |
| runs-on: dstack-ubuntu-latest-32-cores | |
| strategy: | |
| matrix: | |
| flavor: ["base", "devel", "devel-efa"] | |
| ubuntu_version: ["24"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Free up some space | |
| run: | | |
| df -h / | |
| du -hs /usr/share/dotnet | |
| rm -rf /usr/share/dotnet | |
| df -h / | |
| - name: Build and upload to DockerHub | |
| run: | | |
| docker buildx build \ | |
| --platform linux/amd64 \ | |
| --target ${{ matrix.flavor }} \ | |
| --tag dstackai/${{ env.BUILD_DOCKER_REPO }}:${{ inputs.image_version }}-${{ matrix.flavor }}-ubuntu${{ matrix.ubuntu_version }}.04 \ | |
| --build-arg UBUNTU_VERSION=${{ matrix.ubuntu_version }} \ | |
| --provenance=false \ | |
| --push \ | |
| -f base/Dockerfile . |