You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX affects local Dockerfile #6413
o.t.u.ImageNameSubstitutor - Using my.company.registry.net/redis-sentinel:latest as a substitute image for redis-sentinel:latest (using image substitutor: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor'))
The local name redis-sentinel is replaced by my.company.registry.net/redis-sentinel:latest which doesn't make sense at all.
ImageFromDockerfile doesn't consider the TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX value but GenericContainer does it. So, when building the image on-the-fly the image is created without TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX value but when trying to run the image, the image contains TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX value.
Hi @eddumelendez, I'd like to work on this issue. I traced it to RemoteDockerImage.getImageName() applying the default substitutor to Future<String> images: ImageFromDockerfile builds and tags the unprefixed local name, but GenericContainer later resolves the prefixed name. I propose using ImageNameSubstitutor.noop() for future-backed images and adding Docker-free regression tests in RemoteDockerImageTest. I would use AI assistance and disclose it in the PR. Would you be happy with that approach before I proceed?
Activity
gaeljw commentedon Jan 17, 2023
Using
new ImageFromDockerfile()(without giving a name to the image) works fine as a workaround.eddumelendez commentedon Feb 6, 2024
ImageFromDockerfiledoesn't consider theTESTCONTAINERS_HUB_IMAGE_NAME_PREFIXvalue butGenericContainerdoes it. So, when building the image on-the-fly the image is created withoutTESTCONTAINERS_HUB_IMAGE_NAME_PREFIXvalue but when trying to run the image, the image containsTESTCONTAINERS_HUB_IMAGE_NAME_PREFIXvalue.rpallares commentedon Jan 31, 2025
I have the same comportment in .net
marcosflobo commentedon Mar 26, 2025
Is there any update on this?
leo7martins commentedon Nov 24, 2026
Hi @eddumelendez, I'd like to work on this issue. I traced it to
RemoteDockerImage.getImageName()applying the default substitutor toFuture<String>images:ImageFromDockerfilebuilds and tags the unprefixed local name, butGenericContainerlater resolves the prefixed name. I propose usingImageNameSubstitutor.noop()for future-backed images and adding Docker-free regression tests inRemoteDockerImageTest. I would use AI assistance and disclose it in the PR. Would you be happy with that approach before I proceed?