-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Should Composite Container Name be the composer.yml path? #278
Comments
mariotoffia
changed the title
Get container name returns composer.yml path
Should Composite Container Name be the composer.yml path?
Sep 23, 2022
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 var file = Path.Combine(Directory.GetCurrentDirectory(),
(TemplateString) "Resources/ComposeTests/WordPress/docker-compose.yml");
// @formatter:off
using (var svc = 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
var installPage = 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.
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: