microsoft / microsoft/aspire

`ContainerRegistryHook ` can't add image prefix

Open
#4,008 9 comments 0 reactions 0 assignees View on GitHub
area-app-model
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

Prior to preview 6, I had my own version of `ContainerRegistryHook` and was hoping to move over to the built in one introduced in preview 6. Unfortunately it doesn't meet our needs so we're having to continue with our custom implementation.

1. Not only do we need to change the registry name, but we also need to add a prefix to the image name. e.g. we want to convert `docker.io/redis:latest` --> `mycompanymirror.azurecr.io/library/docker.io/redis:latest`.

2. We only want to rewrite the public image registries, not our own internal ones. (Currently our logic is to rewrite everything that isn't `*.azurecr.io`, which whilst not 100% true, works well enough without having to maintain an allow list of all our internal ACRs). It would be helpful if there was an allow/deny list of what registries should get overwritten. Examples of when this may be needed
* Your internal mirror and application registries are in separate container registries.
* Different teams in your company push to different registries internally, but you want to rewrite all public images to the same internal mirror without rewriting the internal apps.

Could you update the built in `ContainerRegistryHook` to account for this? I think you may want to consider this prior to GA as it may impact the API of how this is configured on `DistributedApplicationOptions`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.