Docker.DotNet
Docker.DotNet copied to clipboard
Add configuration "switch to Linux/Windows containers"
Output of dotnet --info:
.NET SDK (reflecting any global.json):
Version: 5.0.202
Commit: db7cc87d51
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.202\
Host (useful for support):
Version: 5.0.5
Commit: 2f740adc14
What version of Docker.DotNet?:
3.125.4
Steps to reproduce the issue: Create docker client and pull image
var dockerClient = new DockerClientConfiguration(new Uri("npipe://./pipe/docker_engine")).CreateClient();
Progress<JSONMessage> progress = new Progress<JSONMessage>();
progress.ProgressChanged += (sender, message) =>
{
Console.WriteLine($"{message.Status}|{message.ProgressMessage}|{message.ErrorMessage}");
};
await dockerClient .Images.CreateImageAsync(
new ImagesCreateParameters
{
FromImage = "docker.elastic.co/elasticsearch/elasticsearch"
},
new AuthConfig(),
progress).ConfigureAwait(false)
What actually happened?: Error is logged while pulling image, no exception thrown
Pulling from elasticsearch/elasticsearch||
||image operating system "linux" cannot be used on this platform
What did you expect to happen?: Image pulled successfully. Provide option to pass OS type/version when creating Docker Client, or change later to point Docker to Linux containers, equivalent to https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers
Additional information:
This is not supported by the Docker Engine API