Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the v1.40 upstream Docker API #25

Merged
merged 6 commits into from
Aug 14, 2019
Merged

Updates to the v1.40 upstream Docker API #25

merged 6 commits into from
Aug 14, 2019

Conversation

fussybeaver
Copy link
Owner

  • Updates the API stubs according to upstream changes.
  • Removes the deny_unknown_fields constraint (thanks @edigaryev )
  • Adds mount option to creating containers

@edigaryev
Copy link
Contributor

Just wondering: do you plan to support only the latest version of Docker API in this library?

Because specifying an API version that is higher than of the server API version when making request effectively causes Docker daemon to return an error: https://github.com/moby/moby/blob/4e83c90ae8362a8205e3728e8fcb655a713a0d87/api/server/middleware/version.go#L58-L60

You can check this yourself by running:

$ DOCKER_API_VERSION=1.41 docker version | grep Error
Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40

Also see Idein/dockworker#51.

@fussybeaver
Copy link
Owner Author

Thanks for pointing that out - it does seem appropriate to have an environment variable, like the official docker client to toggle the API version. Is that something you would like to tackle in a separate PR ?

@edigaryev
Copy link
Contributor

it does seem appropriate to have an environment variable

I'm not sure if that'd be the right way to do tackle this, see the comment pointing to moby/moby#25498 here: gesellix/docker-client#25.

@fussybeaver
Copy link
Owner Author

It does seem like one would need to do something like:

https://github.com/moby/moby/blob/3a4b51ebb8b6559ce4c8f126a7533066369c6182/client/client.go#L223-L246

Although, I'm wondering whether it would just be easier to call the API without a version (like dockworker does).

@fussybeaver
Copy link
Owner Author

Added version negotiation in #27 . @edigaryev is that something you'd be happy with ?

@edigaryev
Copy link
Contributor

Yes, that works for me, thanks!

edigaryev and others added 6 commits August 14, 2019 13:18
…n API responses

Recently Docker 19.03 was released and it introduced the new 1.40 API version
with whole lot of new fields[1], which cause Bollard to fail due to it's use of
deny_unknown_fields serde attribute.

Quote from the Docker Engine API reference[2]:

>The API uses an open schema model, which means server may add extra properties
>to responses.

>Likewise, the server will ignore any extra query parameters and request body
>properties.

>When you write clients, you need to ignore additional properties in responses
>to ensure they do not break when talking to newer daemons.

[1]: https://docs.docker.com/engine/api/version-history/#v140-api-changes
[2]: https://docs.docker.com/engine/api/v1.39/#section/Versioning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants