Daily Docker Build #490
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: Daily Docker Build | |
| on: | |
| schedule: | |
| - cron: "0 13 * * *" # Run daily at 5:00am Pacific Time (UTC-8) | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| # Compute DATE once so all jobs agree even if the workflow spans midnight UTC. | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| date: ${{ steps.date.outputs.date }} | |
| steps: | |
| - id: date | |
| run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| # Build AMD64 base image | |
| build-amd64-base: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push AMD64 base image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: base | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:base-amd64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:base-amd64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Prune Docker | |
| run: | | |
| docker system prune -af | |
| df -h | |
| # Build ARM64 base image | |
| build-arm64-base: | |
| needs: setup | |
| runs-on: ubuntu-24.04-arm | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push ARM64 base image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: base | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:base-arm64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:base-arm64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Prune Docker | |
| run: | | |
| docker system prune -af | |
| df -h | |
| # Build AMD64 prebuilt image | |
| build-amd64-prebuilt: | |
| runs-on: ubuntu-latest | |
| needs: [setup, build-amd64-base] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push AMD64 prebuilt image | |
| id: build-amd64 | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: prebuilt | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:prebuilt-amd64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:prebuilt-amd64 | |
| cache-from: type=gha | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| - name: Build and push AMD64 artifacts image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: artifacts | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:artifacts-amd64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:artifacts-amd64 | |
| cache-from: type=gha | |
| - name: Build & Push Run image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: run | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:run-amd64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:run-amd64 | |
| cache-from: type=gha | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| # Build ARM64 prebuilt image | |
| build-arm64-prebuilt: | |
| runs-on: ubuntu-24.04-arm | |
| needs: [setup, build-arm64-base] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push ARM64 prebuilt image | |
| id: build-arm64 | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: prebuilt | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:prebuilt-arm64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:prebuilt-arm64 | |
| cache-from: type=gha | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| - name: Build and push ARM64 artifacts image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: artifacts | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:artifacts-arm64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:artifacts-arm64 | |
| cache-from: type=gha | |
| - name: Build & Push Run image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| target: run | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:run-arm64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:run-arm64 | |
| cache-from: type=gha | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| # Build AMD64 heavy image | |
| build-amd64-heavy: | |
| runs-on: ubuntu-latest | |
| needs: [setup, build-amd64-prebuilt] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push AMD64 heavy image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| timeout-minutes: 180 # Swift + Fuzzilli + ASAN build takes a while | |
| with: | |
| context: . | |
| file: Dockerfile.heavy | |
| push: true | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:heavy-amd64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:heavy-amd64 | |
| build-args: | | |
| BASE_IMAGE=ghcr.io/${{ github.repository }}:prebuilt-amd64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Build ARM64 heavy image | |
| build-arm64-heavy: | |
| runs-on: ubuntu-24.04-arm | |
| needs: [setup, build-arm64-prebuilt] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Build and push ARM64 heavy image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| timeout-minutes: 180 | |
| with: | |
| context: . | |
| file: Dockerfile.heavy | |
| push: true | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:heavy-arm64-${{ needs.setup.outputs.date }} | |
| ghcr.io/${{ github.repository }}:heavy-arm64 | |
| build-args: | | |
| BASE_IMAGE=ghcr.io/${{ github.repository }}:prebuilt-arm64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Create multi-platform images | |
| create-multiplatform-images: | |
| needs: | |
| [ | |
| setup, | |
| build-amd64-base, | |
| build-arm64-base, | |
| build-amd64-prebuilt, | |
| build-arm64-prebuilt, | |
| build-amd64-heavy, | |
| build-arm64-heavy, | |
| ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| # Create multi-platform base images | |
| - name: Create and push multi-platform base image | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}:base-${{ needs.setup.outputs.date }} \ | |
| -t ghcr.io/${{ github.repository }}:base \ | |
| -t ghcr.io/${{ github.repository }}:latest \ | |
| ghcr.io/${{ github.repository }}:base-amd64 \ | |
| ghcr.io/${{ github.repository }}:base-arm64 | |
| # Create multi-platform prebuilt images | |
| - name: Create and push multi-platform prebuilt image | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}:prebuilt-${{ needs.setup.outputs.date }} \ | |
| -t ghcr.io/${{ github.repository }}:prebuilt \ | |
| ghcr.io/${{ github.repository }}:prebuilt-amd64 \ | |
| ghcr.io/${{ github.repository }}:prebuilt-arm64 | |
| # Create multi-platform heavy images | |
| - name: Create and push multi-platform heavy image | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}:heavy-${{ needs.setup.outputs.date }} \ | |
| -t ghcr.io/${{ github.repository }}:heavy \ | |
| ghcr.io/${{ github.repository }}:heavy-amd64 \ | |
| ghcr.io/${{ github.repository }}:heavy-arm64 | |
| - name: Create and push multi-platform run image | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}:run-${{ needs.setup.outputs.date }} \ | |
| -t ghcr.io/${{ github.repository }}:run \ | |
| -t ghcr.io/${{ github.repository }}:latest \ | |
| ghcr.io/${{ github.repository }}:run-amd64 \ | |
| ghcr.io/${{ github.repository }}:run-arm64 | |
| # Create multi-platform artifacts images | |
| create-multiplatform-artifacts: | |
| needs: | |
| [setup, build-amd64-prebuilt, build-arm64-prebuilt, create-multiplatform-images] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Create and push multi-platform artifacts image | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}:artifacts-${{ needs.setup.outputs.date }} \ | |
| -t ghcr.io/${{ github.repository }}:artifacts \ | |
| ghcr.io/${{ github.repository }}:artifacts-amd64-${{ needs.setup.outputs.date }} \ | |
| ghcr.io/${{ github.repository }}:artifacts-arm64-${{ needs.setup.outputs.date }} |