I try to attach to docker with this code template
Async Function AttachToContainer(DockerHub As DockerClient, ContainerID As String, Cmd As IList(Of String), ExecCts As CancellationToken) As Task
Dim ExecTask = Await DockerHub.Exec.ExecCreateContainerAsync(ContainerID, New ContainerExecCreateParameters With {
.AttachStdin = False,
.AttachStderr = True,
.AttachStdout = True,
.Tty = False,
.Cmd = Cmd
},
ExecCts)
Try
Dim Attach = Await DockerHub.Exec.StartAndAttachContainerExecAsync(ExecTask.ID, False)
Await Attach.CopyOutputToAsync(
Nothing,
Console.OpenStandardOutput(),
Console.OpenStandardError(),
CancellationToken.None)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Function
But failed "cannot hijack chunked or content length stream" (https://github.com/stefanprodan/dockerdash/blob/master/src/Docker.DotNet/Microsoft.Net.Http.Client/HttpConnectionResponseContent.cs)
REST API working successfully, this is background of screen, console application call this code and failed. ExecTask.ID in debugger looking good - 36f40d3f0e03b38da0f9303f2312f68b1e48a0aedf74b856f8b7a6b596da3e33
Interesting, that some other function of Docker.DotNet with the same docker working fine.
What wrong in my code?