-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
[Enhancement]: Allow temporarily disabling TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX
via ImageSubstitutor
#2554
Comments
Hi @zann1x so the issue is when building an image from a Dockerfile, in which we do not have yet an image name as it's empty, right? I can think of why it's happening: the substitutors are always applied before the build image is processed, so the built image receives a tag without the substitutors applied. I think I can elaborate a fix soon for this. Do you mind if I change this issue to a |
Not quite. |
Mmm my question then is, if the build happens in the CI, and your testcontainers settings add the prefix, why does not your CI build all the images (e.g. |
The prefix is only used so that external images (e.g. ryuk) aren't pulled from Docker Hub but are proxied through our own registry. I would have expected that I could simply override the prefixing behavior for internal images on a container level with My problem can indeed be fixed by adding some prefix to the image name. So it would be fine for me if you decide that this feature shouldn't be supported and this issue is closed. |
I'd say that this use case can be bypassed with a custom setup, so I'd try to avoid custom fixes in the library for them. Hope you understand 🙏 |
Yeah, that's perfectly fine 🙂 |
Proposal
When using a custom implementation of an
ImageSubstitutor
while also having setTESTCONTAINERS_HUB_IMAGE_NAME_PREFIX
, the prefix will be prepended if testcontainers decides that the image name still needs a substitution before starting the container. This is adequate behavior for all the cases where there should be a default registry to fall back to if none of the priorImageSubstitutor
s set one. But it poses a problem when the image under test was built and tagged locally and has not been published to a registry yet.It would be great if an
ImageSubstitutor
could have the option disable the prefixing mechanism.The text was updated successfully, but these errors were encountered: