Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I want to pull and run an Image with
Docker.DotNet
and I am desperated, I have no Idea how to do this with this library.
Can anyone help me?
I looked at the tutorial on the
https://github.com/microsoft/Docker.DotNet
but that is not helpful.
public class DockerService
private readonly DockerClient DockerClient;
public DockerService()
if (OperatingSystem.IsWindows())
DockerClient = new DockerClientConfiguration(new Uri("npipe://./pipe/docker_engine")).CreateClient();
else if (OperatingSystem.IsLinux())
DockerClient = new DockerClientConfiguration(new Uri("unix:///var/run/docker.sock")).CreateClient();
throw new Exception("unknown operation system");
public void StartCompose()
var progress = new Progress<JSONMessage>();
var task = PullImage(
new ImagesCreateParameters()
FromImage = "mcr.microsoft.com/dotnet/core/sdk",
Tag = "latest"
},null,
progress);
task.Wait();
private Task PullImage(ImagesCreateParameters imagesCreateParameters, AuthConfig authConfig,
Progress<JSONMessage> progress)
return DockerClient.Images.CreateImageAsync(imagesCreateParameters, authConfig, progress);
I expect something to happen when I start task.wait()? But the it runs for several minutes and nothing happens.
–
Your image name looks wrong. You have the repository, but not the tag.
Looking at: https://hub.docker.com/_/microsoft-dotnet-core-sdk/
suggests you need: mcr.microsoft.com/dotnet/core/sdk:2.2
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.