-
Notifications
You must be signed in to change notification settings - Fork 141
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
Allow custom docker registry #335
Comments
Agreed. I think the best way to extend the current codebase here is to have an optional field in the docker client and produce FQ container names in case they aren't already fully-qualified. There may also be a config in the CLI that we can use. |
Cool, I think I'll give it a try 😃 |
Actually I might want to use the same client against different registries (e.g containers from different registires, but within the same bridge network). Moreover the name of images may vary between registries. For example, AWS ECR for docker library would be: Currently it's enough to set But we don't expose the way to override the name through I think it is correct to allow overriding the name as well as As an alternative we could extend WDYT? |
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. Closes testcontainers#335
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. Closes testcontainers#335
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. Closes testcontainers#335
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. Closes testcontainers#335
Yeah and there is a good reason for that! The |
The contract is already kind of broken with allowing to replace the tag, because nothing can guarantee that everything is working with a new version, especially if the readiness check is log message based. Please don't get me wrong here, being able to replace the tag is crucial at least to me, because I want to mirror my dependency versions in production in tests. |
Yeah, we do allow tag to be overridden and there is a comment that it may broke the image. What do you think about the second solution? We could allow to change only registry and/or owner in Anyway by redefining the tag/name/registry, users clearly take responsibility on themselves. In addition, looks like it's allowed in other languages: https://github.com/testcontainers/testcontainers-go/blob/357cff81c2e44ce1c27112244dce4d40229be347/options.go#L64 (part of |
Moreover, nobody prevents us to expose API to change the name on But I'd better expose it as part of Even changing of ENV var can break the image and we do allow that, otherwise it would be a mess. |
Btw, I think it doesn't work anyway. In practice, I've encountered many cases where a docker tag gets overwritten and breaks existing code based on that particular tag. Just for example: bitnami/containers#55274 - image just didn't work for several days (it affected not only |
Perhaps it is a lost battle until Nix takes over the world. |
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. Closes testcontainers#335
This change allows to override name of the image. Thus, user will be able to change registry, owner and the name itself. See #335 (comment) for more details Closes #335
So TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX environment variable is not supported. I did not expect this as works with other languages, so I have been troubleshooting for few hours |
Its increasingly regulatory compliance issue, companies have to proxy external software supply chains, can't use Internet directly |
@noelmcloughlin currently it's possible to override the registry utilizing ImageExt::with_name |
Thank you, I was looking at ContainerRequest API, but this ImageExt API looks like it might work. |
I think it would be nice to allow some configuration for a custom docker registry to pull the images from.
I'm thinking about a general point of configuration.
This is useful if e.g. you are working in a company that relies on an internal docker repository (e.g. as a caching solution).
The text was updated successfully, but these errors were encountered: