Skip to content

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

Closed

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

Activity

  1. crazy-max commented on Feb 11, 2026

    @crazy-max
    Member

    Thanks for reporting, can you show the build command issued by build-push-action similar to https://github.com/docker/build-push-action/actions/runs/21904053453/job/63239525652#step:6:189. I would like to check the resolved git context URL. We might need to dynamically set the scope for GHES.

  2. crazy-max commented on Feb 11, 2026

    @crazy-max
    Member

    In the meantime you can use this workaround:

          -
            name: Build and push
            uses: docker/build-push-action@v6
            with:
              push: true
              tags: user/app:latest
              secrets: |
                GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
  3. KThompson-Lane-Unity commented on Feb 11, 2026

    @KThompson-Lane-Unity
    Author

    Hey @crazy-max thanks for responding so quickly! That workaround will definitely unblock us for now

    build command

    /usr/bin/docker buildx build --cache-from type=registry,ref=!!REDACTED!! --cache-to type=!!REDACTED!!,mode=max --file Frontend.Dockerfile --iidfile /home/runner/_work/_temp/docker-actions-toolkit-KAocJD/build-iidfile-c0ace8a810.txt \
     --attest type=provenance,mode=min,inline-only=true,builder-id=https://github.cds.internal.!!REDACTED!!.com/!!REDACTED!! --secret id=!!REDACTED!! \
     --secret id=GIT_AUTH_TOKEN.github.com,src=/home/runner/_work/_temp/docker-actions-toolkit-KAocJD/tmp-911-oNSbM0oUJ89m \ 
    --tag !!REDACTED!!:latest --tag !!REDACTED!!:!!GIT_SHA!! --metadata-file /home/runner/_work/_temp/docker-actions-toolkit-KAocJD/build-metadata-9f1063c7e0.json --push https://github.cds.internal.!!REDACTED!!.com/!!REDACTED!!
    

    (New lines \ added by me). Let me know if you want any additional info :)

  4. crazy-max commented on Feb 11, 2026

    @crazy-max
    Member

    https://github.cds.internal.!!REDACTED!!.com/!!REDACTED!!

    Ok this is definitely a host scope issue. I opened #1456

    Can you try with:

          -
            name: Build and push
            uses: crazy-max/docker-build-push-action@auth-token-dyn-host
  5. eeue56 commented on Feb 11, 2026

    @eeue56

    Tested that, it fixed it for us.

    https://github.cds.internal.!!REDACTED!!.com/!!REDACTED!!

    Ok this is definitely a host scope issue. I opened #1456

    Can you try with:

      -
        name: Build and push
        uses: crazy-max/docker-build-push-action@auth-token-dyn-host
    
  6. crazy-max commented on Feb 11, 2026

    @crazy-max
    Member

    @eeue56 Great thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions