docker / docker/build-push-action

After successfully logging into my registry, the image push fails as it's trying against the local IP

Open
#1,270 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status/triage
Dominant language
TypeScript
Stars
5.4k
Forks
735
Avg merge
3d 9h
Merged PRs (30d)
14

Description

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

I have a registry running locally, externally accessibly via registry.example.com. The Github action can log into my registry fine, but the docker push fails. Has anyone had this before?

Expected behaviour

Docker image pushes to my registry

Actual behaviour

It resolves the internal IP address and tries to push there

#38 [auth] sharing credentials for registry.example.com
#38 DONE 0.0s
#37 exporting to image
#37 33.19 error: failed to copy: failed to do request: Put "https://192.168.1.171/v2/repo-name/blobs/uploads/941b40a9-d6fb-4701-aded-385eec9dcb55?_state=_syVg7StDX9rNYAzmMqpuTIdHItl9e_dkJQ29zDiiO17Ik5hbWUiOiJob3BraW5zb24tY21zIiwiVVVJRCI6Ijk0MWI0MGE5LWQ2ZmItNDcwMS1hZGVkLTM4NWVlYzlkY2I1NSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0xMS0zMFQxMDowNjoxNi43MjM4NDAxMDJaIn0%3D&digest=sha256%3A17f01ce0086807fa706f33dba43b139ee9b1f8b38eed3825f6eea4005d7a4d3d": dial tcp 192.168.1.171:443: i/o timeout
Repository URL

No response

Workflow run URL

No response

YAML workflow
-   name: Login to My Registry
                uses: docker/login-action@v3
                with:
                    registry: ${{ vars.DOCKER_REGISTRY }}
                    username: ${{ vars.DOCKER_USERNAME }}
                    password: ${{ secrets.DOCKER_PASSWORD }}

            -   name: Login to My Pull Registry
                uses: docker/login-action@v3
                with:
                    registry: ${{ vars.DOCKER_PULL_REGISTRY }}
                    username: ${{ vars.DOCKER_USERNAME }}
                    password: ${{ secrets.DOCKER_PASSWOR

            -   name: Build Docker image
                uses: docker/build-push-action@v6
                with:
                    provenance: false # Fails with or without this, just here from testing
                    push: true
                    tags: |
                        registry.example.com/${{ github.event.repository.name }}:${{ github.sha }}
                        registry.example.com/${{ github.event.repository.name }}:latest
                    cache-from: type=gha
                    cache-to: type=gha,mode=max
                env:
                    BUILDKIT_PROGRESS: plain
                    DOCKER_BUILDKIT_DEBUG: "true"
Workflow logs

No response

BuildKit logs

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied workflow, especially the docker/login-action and docker/build-push-action steps, and inspect the BuildKit push error showing registry.example.com resolved to 192.168.1.171. Reproduce the push with the same registry configuration and determine why the push target changes to the internal IP; done when the action pushes through the configured registry hostname or clearly documents the required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions
Domain
ci-cd, devops, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.