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
The svc.Name returns "/root/DockerFiles/test.yml"
I expected it to return: docker-container-1 docker container ls returns the correct container name (but with _client_1 added)
Please let me know if this is the correct way to set the name.
The text was updated successfully, but these errors were encountered:
Hi @Fewiel - this is by design. It will return a ICompositeService and it's composition is determined by the "/root/DockerFiles/test.yml". Inspect the contained services to get their respective name.
If there are any problems, please let me know.
From README.md
varfile= Path.Combine(Directory.GetCurrentDirectory(),(TemplateString)"Resources/ComposeTests/WordPress/docker-compose.yml");// @formatter:offusing(varsvc=new Builder().UseContainer().UseCompose().FromFile(file).RemoveOrphans().WaitForHttp("wordpress","http://localhost:8000/wp-admin/install.php").Build().Start())// @formatter:on{// We now have a running WordPress with a MySql database varinstallPage=await"http://localhost:8000/wp-admin/install.php".Wget();
Assert.IsTrue(installPage.IndexOf("https://wordpress.org/", StringComparison.Ordinal)!=-1);
Assert.AreEqual(1, svc.Hosts.Count);// The host used by compose
Assert.AreEqual(2, svc.Containers.Count);// We can access each individual container
Assert.AreEqual(2, svc.Images.Count);// And the images used.}
I need to set up a container and get the name back to start and stop it later.
Code to create the container:
test.yml:
The
svc.Name
returns "/root/DockerFiles/test.yml"I expected it to return: docker-container-1
docker container ls
returns the correct container name (but with _client_1 added)Please let me know if this is the correct way to set the name.
The text was updated successfully, but these errors were encountered: