-
-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
I need to set up a container and get the name back to start and stop it later.
Code to create the container:
var svc = new Builder()
.UseContainer()
.WithName("docker-container-1")
.UseCompose().ServiceName("docker-container-1")
.FromFile("/root/DockerFiles/test.yml")
.RemoveOrphans()
.Build().Start();test.yml:
version: "3"
services:
client:
image: nginx
ports:
- 80:80
volumes:
- ./src:/usr/share/nginx/htmlThe 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.