Open hakimdotdev opened 1 year ago
I am unable to recreate the issue. I am receiving the created containers. Is the variable containers
empty, or does it simply not contain the container with the expected name?
var containers = await new DockerClientConfiguration().CreateClient().Containers.ListContainersAsync(new ContainersListParameters());
_containers.AddRange(containers);
var statuses = _containers.Select(c => $"{c.Names.FirstOrDefault()}: {c.State}");
return statuses.ToList();
will return all containers with name and state properly but trying to get the object or just the id from the name will leave the passed object empty.
EDIT:
The name is passed properly, what had to be done is querying Names[0]
not the IList itself.
Output of dotnet --info:
.NET SDK: Version: 7.0.302 Commit: 990cf98a27 What version of Docker.DotNet?:
Latest Nuget Steps to reproduce the issue:
Or Any other Linq Query **What actually happened?:*** Sequence is Empty
What did you expect to happen?: To be able to retrieve the First or really any container from the IList with query or somehow to be able to get .ID for StartAsync
I'm trying to get a single container followed by its ID from name.Is there some way to easily achieve this, which I'm missing out on? I couldn't deduce anything off of the documentation available in the repo. Thanks in Advance.