fix: bypass docker login, pre-populate auth config for HTTP registry push

This commit is contained in:
admin
2026-03-04 20:18:20 +00:00
parent 392d4925cf
commit b86c76a2fc

View File

@@ -112,7 +112,12 @@ jobs:
- name: Push to registry
if: env.REGISTRY != ''
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
# docker login sends POST /auth to Podman which incorrectly tries HTTPS even for
# insecure registries. Pre-populate config.json instead — docker push goes through
# the Podman daemon which correctly uses HTTP (insecure=true in registries.conf).
mkdir -p ~/.docker
AUTH=$(echo -n "${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_PASSWORD }}" | base64 -w 0)
echo "{\"auths\":{\"${{ env.REGISTRY }}\":{\"auth\":\"${AUTH}\"}}}" > ~/.docker/config.json
docker push "${{ steps.image.outputs.full }}"
- name: Save image to file