Closed kevinboss closed 1 year ago
After downgrading to 4.18 everything seems to work once again. I have however not enough knowledge with the docker API to understand if this is related to an Issue in the Library or Docker itself.
I do not know why it fails for the latest version, but I think (guess) the generated model (CommitContainerChangesParameters
) is wrong. If you compare the /containers/create and the /commit API endpoint, you will notice that Docker.DotNet defines the models different.
While CreateContainerParameters annotates all query parameters and request body properties, CommitContainerChangesParameters does not. The request body Config
is a nested type and I think that might be wrong.
Could you please check the HTTP request that Docker.DotNet creates and sends? This should help us understand the issue.
Maybe it is a regression or a change in the latest release of Moby, which is included in Docker Desktop 4.19.0.
I have debugged HttpConnection. Docker.DotNet sends
POST /commit?container=939eab072cd3cb77123d178c78ed872fe36194fde949ffd737c330198b2ee95f&repo=docker%2Fgetting-started&tag=latest-20230510102730 HTTP/1.1 User-Agent: Docker.DotNet Host: docker_engine:80 Connection: close
and gets
HTTP/1.1 400 Bad Request Api-Version: 1.42 Content-Type: application/json Date: Wed, 10 May 2023 20:29:25 GMT Docker-Experimental: false Ostype: linux Server: Docker/23.0.5 (linux) Connection: close Transfer-Encoding: chunked
in return.
My issue is fixed however, as soon as I set Config to new Config everything works fine. Maybe the fallback here should be an empty object instead of null?
Is this fixed in the library, or is this just a workaround? I ran into this today and used this workaround as well and it works. I feel like if this hasn't been fixed it shouldn't have been closed.
Is this fixed in the library, or is this just a workaround? I ran into this today and used this workaround as well and it works. I feel like if this hasn't been fixed it shouldn't have been closed.
I added PR#636
Output of
dotnet --info
:What version of Docker.DotNet?:
Steps to reproduce the issue: Execute CommitContainerChanges with Docker Desktop for Windows, Version 4.19.0 (106363) with the following parameters:
What actually happened?:![image](https://user-images.githubusercontent.com/4927587/235692091-ba962970-36c8-4689-ad42-5a5767813b42.png)
What did you expect to happen?: New image is created from running container
Additional information: I feel like it worked up until the last Docker Desktop update (this is only a hunch however).