Support for passing platform
Similar to https://github.com/testcontainers/testcontainers-rs/issues/500 it would be great to have feature parity with the CLI. The suggested workaround does work but is quite inconvenient, we have migrated one project to use bollard directly such that we could specify the platform when launching the container.
After looking at the other implementations, this could perhaps be a more general request. We could expose a lower level API, similar to withCreateCmdModifier in testcontainers-java, and that could be used to configure various options:
- platform
- CPU and memory limits for repeatable environments for performance
- runtimes, to enable GPU support like in the Ollama module
just honor DOCKER_DEFAULT_PLATFORM
As it was discussed it's not enough to simply rely on DOCKER_DEFAULT_PLATFORM as testcontainers supports remote hosts (and Testcontainers Cloud) that may differ from the local setup.
So it's been addressed with hybrid approach:
- #800 auto detection of
DOCKER_DEFAULT_PLATFORM- but with fallback to default platform in #837 if image pull failed
- Ability to configure platform explicitly in the code via
ImageExtin #838
As it was discussed it's not enough to simply rely on
DOCKER_DEFAULT_PLATFORM
Potentially not enough in some scenarios, but still essential. Just to clarify, NOT honoring DOCKER_DEFAULT_PLATFORM is a bug in itself (i hit on this bug in a scenario i don't remember anymore...)
What are you trying to say? Did anyone argued that it should not be honored? Issue was accepted initially Ignoring other scenarios also would be a bug as it's common enough to use remote hosts and etc, even for DinD use-cases in CI
Message above was intended to provide the context of how it works now
What are you trying to say?
Oh, this twisting. Cu around.