fix: bypass docker login, pre-populate auth config for HTTP registry push
This commit is contained in:
@@ -112,7 +112,12 @@ jobs:
|
|||||||
- name: Push to registry
|
- name: Push to registry
|
||||||
if: env.REGISTRY != ''
|
if: env.REGISTRY != ''
|
||||||
run: |
|
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 }}"
|
docker push "${{ steps.image.outputs.full }}"
|
||||||
|
|
||||||
- name: Save image to file
|
- name: Save image to file
|
||||||
|
|||||||
Reference in New Issue
Block a user