name: docker-base # Checks that scripts/Dockerfile.base still builds for every platform. It never # publishes: releases build their own base image, and coder/ghcr-publisher # publishes it as ghcr.io/coder/coder-base (moving :latest with each new # highest stable release). Other builds use ghcr.io/coder/coder-base:latest. on: pull_request: # Self-reference on `pull_request` is intentional: a PR that edits this # workflow runs the build to verify the YAML is well-formed and the # base image still builds. See DOCS-129 for the broader # workflow-self-reference audit. paths: - scripts/Dockerfile.base - provisioner/terraform/terraform_SHA256SUMS - .github/workflows/docker-base.yaml permissions: contents: read # Avoid running multiple jobs for the same commit. concurrency: group: ${{ github.workflow }}-${{ github.ref }}-docker-base jobs: build: permissions: # Necessary for depot.dev authentication. id-token: write runs-on: ubuntu-latest if: github.repository_owner == 'coder' steps: - name: Harden Runner uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2 with: egress-policy: audit - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # Dockerfile.base only needs the Terraform checksum file from the repo. - name: Create base-build-context directory run: | mkdir base-build-context cp provisioner/terraform/terraform_SHA256SUMS base-build-context/ - name: Install depot.dev CLI uses: depot/setup-action@91bc8495a33ebfc504ffc89e5674379ccf23c29c # v1.7.2 # This uses OIDC authentication, so no auth variables are required. - name: Build base Docker image via depot.dev uses: depot/build-push-action@98e78adca7817480b8185f474a400b451d74e287 # v1.18.0 with: project: wl5hnrrkns context: base-build-context file: scripts/Dockerfile.base platforms: linux/amd64,linux/arm64,linux/arm/v7 pull: true no-cache: true push: false