-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
feat: add custom container registry substitutor #2647
feat: add custom container registry substitutor #2647
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The new substitutor can be used by modules whose images are not placed on DockerHub by default. This way, you don't need to manually prefix your image with a custom container registry. Instead, you can configure your registry with a prefix at the configuration level using hub.image.name.prefix.
d82c3e6
to
344d43a
Compare
…to feat/custom-cr-substitutor
@stillya thanks for submitting the PR. After discussing this on Slack, and seeing the code, I think the substitutor could make sense. I have one question regarding
Do you have issues updating the properties file on the CI, configuring the echo "hub.image.name.prefix=quay.io" >> ~/.testcontainers.properties as part of your Github action job, jenkins job, etc. I'd like to understand the reasons why it's not possible to do that. Of course, if it's in code, the settings are applied to everybody, that's why I consider this changeset correct. Just want verify you have a workaround in the meantime. |
Responding to myself (thanks @kiview): setting the properties will apply to all containers, but the substitutor will apply to the ones of interest. |
Yep, that's the reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
* main: feat: add grafana-lgtm module (#2660) Added valkey module (#2639) fix: container.Endpoint and wait.FortHTTP to use lowest internal port (#2641) chore: test cleanups (#2657) docs: fix compilation of examples (#2656) feat: add custom container registry substitutor (#2647) fix: couchbase containers intermittently hang on startup (#2650) chore(deps): bump Ryuk to 0.8.1 (#2648) fix: retry on label error (#2644) perf: optimise docker authentication config lookup (#2646)
Custom Registry Substitutor
What does this PR do?
The new substitutor can be used by modules whose images are not placed on
DockerHub
by default. This way, you don't need to manually prefix your image with a custom container registry. Instead, you can configure your registry with a prefix at the configuration level using hub.image.name.prefix.In a development environment,
hub.image.name.prefix
is commonly empty, soCustomHubSubstitutor
will add the desired default prefix. However, in a CI environment, the default prefix will not be added, and the config prefix will be used (handled byprependHubRegistry
).Usage