Skip to content

Support private repositories #19

@cthtrifork

Description

@cthtrifork
sudo podman run --rm \
...
    -e PREV_REF="${{ inputs.prev-ref }}" \
...
    ${{ inputs.rechunk }} \
...

Will partially fail if the prev-ref is for a private image.
It will still rechunk the new image, but skopeo wont succed when trying to get the previous manifest:
https://github.com/hhd-dev/rechunk/blob/master/3_chunk.sh#L32

I propose syncing the auth.json file to podman in your action:

sudo podman run --rm \
    -v "${HOME}/.config/containers/auth.json:/run/containers/0/auth.json:ro" \
...
    -e PREV_REF="${{ inputs.prev-ref }}" \
...
    ${{ inputs.rechunk }} \
...

alternatively use skopeo --creds with env vars:

if [ -n "$REGISTRY_AUTH_USERNAME" ] && [ -n "$REGISTRY_AUTH_PASSWORD" ]; then
    skopeo inspect \
      --creds "${REGISTRY_AUTH_USERNAME}:${REGISTRY_AUTH_PASSWORD}" \
      docker://${PREV_REF}
else
    skopeo inspect docker://${PREV_REF}
fi

I can make a PR for this. Let me know what you think

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions