Replies: 4 comments 8 replies
-
I'm really interested in those potential, more complex use cases without DNS or hostnames, to have an even wider overview of the problem we want to resolve. As I said in #587 (comment), we are open to the addition once we understand them better. I have to admit that we (I) probably merged #394 without as much context as the one I have know (joined as a full time maintainer in August), and in that sense, I can share here that Testcontainers (in any available language) is not a generic Docker client that needs to expose all methods and config params of the underlying Docker client. In any case, we'd like to cooperate with you in improving the setup of your tests, and that could lead to merging #587 into the code |
Beta Was this translation helpful? Give feedback.
-
Hi @oktalz just to let you know, we released 0.18.0 yesterday, which comes with an interesting feature: it allows customising certain, internal Docker types via 3 modifier functions in the container request: https://golang.testcontainers.org/features/creating_container/#advanced-settings Please let us know if this ability helps you out under the specific conditions of your test suite. I'd like to personally thank you for opening this discussion, which led to this change, making us to much better understand the real needs under the request. 🙇 Thank you! |
Beta Was this translation helpful? Give feedback.
-
Given this feature has been implemented with the request modifiers, I'm closing this issue as Done. Thanks for opening this discussion, which led to a feature request! |
Beta Was this translation helpful? Give feedback.
-
For anyone who arrived here Google searching for a quick answer, here it is: EnpointSettingsModifier: func(m map[string]*network.EndpointSettings) {
m["networkname"].IPAMConfig = &network.EndpointIPAMConfig{
IPv4Address: ip,
}
}, Big thanks to this GitHub repo maintainers and contributors! |
Beta Was this translation helpful? Give feedback.
-
there is already option to set custom IPAM setting to a network seen here [network.go#L40)](https://github.com/testcontainers/testcontainers-go/blob/main/network.go#L40
Could we add similar option to container itself ?
underline code-base already allows setting that options as it can be seen github.com/docker/docker/api/types/network
so it is just a matter of passing those values to it.
since IPAMConfig is a pointer, by default is nil, this feature can be added without changing of behavior of a library
potential use cases are many, but with using some protocols that can't use DNS, of hostnames this is very much welcomed.
in more complex tests where each instance must know/need to have list of all nodes/containers prior to run this would also help.
currently only way of doing that is run all containers, fetch the IPs, stop all containers, create a valid configuration for services, and then start containers again with known IP addresses.
option to set IP address in advance would greatly speed up test in that particular use case
you can also do that in docker compose for example, but I would like to see more Go native way and not run docker compose up and then cleanup after the test is run (so, by using this library and not with external tools)
Beta Was this translation helpful? Give feedback.
All reactions