Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Remote images take precedence over localhost images #66

Open
PhrozenByte opened this issue Jun 21, 2022 · 2 comments · May be fixed by #100
Open

[BUG] Remote images take precedence over localhost images #66

PhrozenByte opened this issue Jun 21, 2022 · 2 comments · May be fixed by #100
Labels
bug Something isn't working

Comments

@PhrozenByte
Copy link

PhrozenByte commented Jun 21, 2022

Version

redhat-actions/push-to-registry@v2 (pointing to redhat-actions/[email protected])

Describe the bug

push-to-registry currently does not support manually specifying the local image to push to the registry (also see #58, suggesting a local input). It rather uses the (unqualified) image name as reference. This will cause issues when Podman's registry search path (i.e. Podman's default registries.conf) doesn't resolve the unqualified image name to the local storage, but a registry. push-to-registry might end up pushing the wrong image...

Steps to reproduce, workflow links, screenshots

See https://github.com/SGSGermany/debian/runs/6995305321?check_suite_focus=true#step:8:113

Here I'm building a base image for Debian-based containers. The source is docker.io/debian:bullseye (digest sha256:ea4b2132c62e73f34156f416e5e21247b58f5cb4ab23105071ca94472f78d02d) and the image built (digest sha256:9b831a98b2faed194c86234c8f4e9111eb38c44652530a40601b698056315453) is tagged with debian:bullseye (among others, e.g. debian:v11). I'm trying to push this image with all its tags to ghcr.io/sgsgermany/debian.

As you can see, push-to-registry pushes docker.io/debian:bullseye for the bullseye tag, and not the expected localhost/debian:bullseye (compare digests; digests of the pushed debian:bullseye and debian:v11 don't match, even though localhost/debian:bullseye and localhost/debian:v11 match).

push-to-registry should always use a fully-qualified image name for the local image (i.e. /usr/bin/podman push --quiet --digestfile debian-v11.3_digest.txt localhost/debian:bullseye ghcr.io/sgsgermany/debian:bullseye --tls-verify=true). Another solution might be to set CONTAINERS_REGISTRIES_CONF=/dev/null for podman push, but this needs verification.

@PhrozenByte PhrozenByte added the bug Something isn't working label Jun 21, 2022
@PhrozenByte
Copy link
Author

Any updates on this? push-to-registry still pushes the wrong images.

There should at least be some warning that the image name is ambiguous and push-to-registry should perform some basic problem resolution. This doesn't necessarily mean to always choose the localhost image; another solution might be to choose the image matching the first given tag (just be careful not to re-introduce #57), and fail if the image matching the first given tag is not among the image alternatives; yet another solution is to add a local input to specify the local image to push manually.

Since this is open for about a year now, the workflow logs were deleted. Here's a new one: https://github.com/SGSGermany/debian/actions/runs/5062208592/jobs/9087436977#step:9:115

PhrozenByte added a commit to SGSGermany/ubuntu that referenced this issue Jun 17, 2023
PhrozenByte added a commit to SGSGermany/ubuntu that referenced this issue Jun 17, 2023
PhrozenByte added a commit to SGSGermany/ubuntu that referenced this issue Jun 17, 2023
PhrozenByte added a commit to SGSGermany/debian that referenced this issue Jun 17, 2023
PhrozenByte added a commit to SGSGermany/debian that referenced this issue Jun 17, 2023
@travier
Copy link

travier commented Nov 17, 2023

I think I've had a similar issue in redhat-actions/buildah-build#129, which I "solved" via travier/quay-containerfiles@6378604.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants