Closed mu88 closed 7 months ago
This is not an issue. This is how Docker stores the container name internally. See the following commands:
docker run --name foo httpd
docker inspect --format '{{.Name}}' foo
We do not modify any data here; we simply forward it. I do not want to change it TBH.
Oh wow, I didn't know that! 😲 Learning never stops...
Could you image introducing a dedicated property that corresponds to the value one sees via docker -ps
? If not it's also fine, just close the issue :)
As mentioned, I have no intention to change it. We do not recommend using the container name (setting it through the builder's API) anyway. In case you need to set up a container-to-container communication, you can use WithNetworkAliases(string)
. Or is there any other use case I am missing?
I will try whether WithNetworkAliases
helps in my use case 💪🏻
Testcontainers version
3.7.0
Using the latest Testcontainers version?
Yes
Host OS
Windows 10
Host arch
x64
.NET version
8.0.101
Docker version
Docker info
What happened?
When starting a container, the
Name
property always starts with a/
which is not present when runningdocker ps
:Relevant log output
No response
Additional information
At the moment, the following test fails:
I'm happy to provide a fix if it's a smaller issue and you can help me walk in the right direction.