garmin / pyrex

Seamless container setup for developing with OpenEmbedded/Yocto Project
Apache License 2.0
38 stars 30 forks source link

Custom registry and tagging images #87

Open haadr opened 1 year ago

haadr commented 1 year ago

Having a tag like

tag = my/great/image:pyrex-v2

and a registry like

registry = ghcr.io

When I build my image, the resulting docker image will be named/tagged as my/great/image:pyrex-v2, ie. without the registry information. AFAICT I then need to make sure that I or my users do not push it to docker.io by mistake, since that's the default registry.

When I let pyrex pull my image automatically (via whisk) the image will be named/tagged as ghcr.io/my/great/image:pyrex-v2.

Ideally I'd like my image to always contain the custom registry in its tag, even when built myself. But I don't see how I can do that without modifying pyrex's source. If I prepend the tag with my registry this will let me build a correctly-tagged image, but during fetching pyrex will prepend the registry yet again to the tag and try to fetch an image tagged ghcr.io/ghcr.io/my/greate/image....

Of course we can simply patch pyrex to always prepend the registry even when building locally and make sure to not append it if the user prepended it manually in pyrex.ini.

Do you have any thoughts about this? I'd like to minimize the risk of things being pushed to docker.io by mistake. Maybe a small thing, but :shrug: