Skip to content

Build fails when trying to run docker-build-push from GitHub Enterprise Server repository #1455

@KThompson-Lane-Unity

Description

@KThompson-Lane-Unity

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

When running the build-push-action v6.19.0 on a GHES repository, the action fails with almost identical output to #1450. Except I do not specify the the git URL in the build context. This has only started happening since #1451 so I assume it's caused by defaulting to github.com instead of our GHES instance.

Expected behaviour

  1. Run build-push-action without specifying GitHub server in the context input
  2. Action succeeds to build

Actual behaviour

  1. Run build-push-action without specifying GitHub server in the context input
  2. Action fails with exit status 128

Repository URL

No response

Workflow run URL

No response

YAML workflow

jobs:
  ...
  build:
    name: Build & push ${{ inputs.environment }} ${{ matrix.service.serviceName }}
    runs-on: !!redacted!!
    permissions: write-all
    needs: [ test ]
    strategy:
      matrix:
        service:
          - serviceName: Frontend
            servicePath: Frontend
            imageName: !!REDACTED!!
          ...
    concurrency: ${{ inputs.environment }}-${{ github.ref }}-${{ matrix.service.serviceName }}
    steps:
      ...
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
      
      - name: Build and push ${{ matrix.service.serviceName }}
        uses: docker/build-push-action@v6
        with:
          push: true
          context: "{{ defaultContext }}:!!REDACTED!!.${{ matrix.service.servicePath }}"
          file: "${{ matrix.service.serviceName }}.Dockerfile"
          tags: |
            ${{ steps.set-env.outputs.docker_registry }}/${{ matrix.service.imageName }}:latest
            ${{ steps.set-env.outputs.docker_registry }}/${{ matrix.service.imageName }}:${{ github.sha }}
          cache-from: type=registry,ref=${{ steps.set-env.outputs.docker_registry }}/${{ matrix.service.imageName }}:buildcache
          cache-to: type=registry,ref=${{ steps.set-env.outputs.docker_registry }}/${{ matrix.service.imageName }}:buildcache,mode=max
          secrets: |
            !!REDACTED!!

Workflow logs

No response

BuildKit logs


Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions