Extract common code from Maven and Container virtual registry shared context for reuse
What does this MR do and why?
In !204090 (merged), we added the container virtual registry shared context that is inspired by Maven's. In this MR, we extract the common code and reuse them in Maven and Container virtual registries' shared contexts.
MR acceptance checklist
Related to #569364 (closed)