dotnet / dotnet/Docker.DotNet

Add configuration "switch to Linux/Windows containers"

Open
#523 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
416
PR merge metrics
No merged PRs in 30d

Description

**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 progress = new Progress();
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](https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers)

**Additional information:**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.