ℹ️ Upgrade Notes
- Minimum supported Python version is 3.7+
- When installing with pip, the `docker[tls]` extra is deprecated and a no-op,
use `docker` for same functionality (TLS support is always available now)
- Native Python SSH client (used by default / `use_ssh_client=False`) will now
reject unknown host keys with `paramiko.ssh_exception.SSHException`
- Short IDs are now 12 characters instead of 10 characters (same as Docker CLI)
- Version metadata is now exposed as `__version__`
✨ Features
- Python 3.10 support
- Automatically negotiate most secure TLS version
- Add `platform` (e.g. `linux/amd64`, `darwin/arm64`) to container create & run
- Add support for `GlobalJob` and `ReplicatedJobs` for Swarm
- Add `remove()` method on `Image`
- Add `force` param to `disable()` on `Plugin`
🐛 Bugfixes
- Fix install issues on Windows related to `pywin32`
- Do not accept unknown SSH host keys in native Python SSH mode
- Use 12 character short IDs for consistency with Docker CLI
- Ignore trailing whitespace in `.dockerignore` files
- Fix IPv6 host parsing when explicit port specified
- Fix `ProxyCommand` option for SSH connections
- Do not spawn extra subshell when launching external SSH client
- Improve exception semantics to preserve context
- Documentation improvements (formatting, examples, typos, missing params)
🔧 Miscellaneous
- Upgrade dependencies in `requirements.txt` to latest versions
- Remove extraneous transitive dependencies
- Eliminate usages of deprecated functions/methods
- Test suite reliability improvements
- GitHub Actions workflows for linting, unit tests, integration tests, and
publishing releases
Changelog
* Update changelog for 5.0.3 by aiordache in https://github.com/docker/docker-py/pull/2897
* Add support for Python 3.10 by hugovk in https://github.com/docker/docker-py/pull/2898
* Bump paramiko from 2.8.0 to 2.10.1 by dependabot in https://github.com/docker/docker-py/pull/2974
* deps: upgrade pywin32 & relax version constraint by milas in https://github.com/docker/docker-py/pull/3004
* ci: remove Python 3.6 and add 3.11 pre-releases by milas in https://github.com/docker/docker-py/pull/3005
* utils: fix IPv6 address w/ port parsing by milas in https://github.com/docker/docker-py/pull/3006
* test_create_with_device_cgroup_rules: don't check devices.list by thaJeztah in https://github.com/docker/docker-py/pull/2940
* Fix exception semantics in _raise_for_status by kmaork in https://github.com/docker/docker-py/pull/2954
* tls: use auto-negotiated highest version by milas in https://github.com/docker/docker-py/pull/3007
* sshcon: remove use of self.ssh_conf by glicht in https://github.com/docker/docker-py/pull/2993
* Use `packaging` instead of `distutils` for `Version` by FrancescoCasalegno in https://github.com/docker/docker-py/pull/2931
* test: fix a couple flaky/broken tests by milas in https://github.com/docker/docker-py/pull/3008
* ci: add flake8 job by milas in https://github.com/docker/docker-py/pull/3009
* Fixes and improvements by kinday in https://github.com/docker/docker-py/pull/2947
* deps: test on Python 3.10 by default by milas in https://github.com/docker/docker-py/pull/3010
* deps: remove backports.ssl_match_hostname by milas in https://github.com/docker/docker-py/pull/3011
* Fix: fix CVE-2020-28243 by errorcode7 in https://github.com/docker/docker-py/pull/2910
* Fix for CWE-295: Improper Certificate Validation by avnes in https://github.com/docker/docker-py/pull/2932
* Set daemon attribute instead of using setDaemon method that was deprecated in Python 3.10 by tirkarthi in https://github.com/docker/docker-py/pull/2823
* Remove unnecessary pass statements by vilhelmprytz in https://github.com/docker/docker-py/pull/2541
* ci: run SSH integration tests by milas in https://github.com/docker/docker-py/pull/3012
* docs: fix simple typo, containe -> container by timgates42 in https://github.com/docker/docker-py/pull/3015
* ci: bump version to 6.0.0-dev by milas in https://github.com/docker/docker-py/pull/3013
* deps: upgrade & remove unnecessary dependencies by milas in https://github.com/docker/docker-py/pull/3014
* lint: fix line length violation by milas in https://github.com/docker/docker-py/pull/3017
* docs: fix markdown rendering by milas in https://github.com/docker/docker-py/pull/3020
* Return 12 character short_ids by benfasoli in https://github.com/docker/docker-py/pull/2862
* api: preserve cause when re-raising error by milas in https://github.com/docker/docker-py/pull/3023
* deps: upgrade websocket-client to latest by milas in https://github.com/docker/docker-py/pull/3022
* Add platform parameter for create_container() by felixfontein in https://github.com/docker/docker-py/pull/2927
* Support cgroupns option in containers.run/containers.create by david0 in https://github.com/docker/docker-py/pull/2930
* Prevent pip cache in Docker image to save image size by PeterDaveHello in https://github.com/docker/docker-py/pull/2828
* Update: allow "force" parameter in plugin.disable() by till in https://github.com/docker/docker-py/pull/2843
* Fix: Issue 2832 Allowing Rollback Config Arg for Services by ercildoune in https://github.com/docker/docker-py/pull/2917
* model: add remove() to Image by milas in https://github.com/docker/docker-py/pull/3026
* fix(dockerignore): trim trailing whitespace by kalioz in https://github.com/docker/docker-py/pull/2733
* Fix TLS server check example to actually verify by scop in https://github.com/docker/docker-py/pull/2574
* Clarify TLSConfig verify parameter docs by scop in https://github.com/docker/docker-py/pull/2573
* Add healthcheck doc for container.run by JanoschDeurer in https://github.com/docker/docker-py/pull/2595
* Fix image save example by hristog in https://github.com/docker/docker-py/pull/2570
* Changed a few words to be more clear by InnovativeInventor in https://github.com/docker/docker-py/pull/2489
* docs: fix RollbackConfig/Order values by milas in https://github.com/docker/docker-py/pull/3027
* ci: add workflow for releases by milas in https://github.com/docker/docker-py/pull/3018
* remove duplicate 'on' in comment by thomasgassmann in https://github.com/docker/docker-py/pull/2370
* Add `gzip` documentation to `BuildApiMixin` by SauravMaheshkar in https://github.com/docker/docker-py/pull/2929
* Use `preexec_func` always by q0w in https://github.com/docker/docker-py/pull/2920
* Remove docker.credentials.utils.find_executable by n1ngu in https://github.com/docker/docker-py/pull/3028
* Support `global-job` and `replicated-job` modes in Docker Swarm by kinday in https://github.com/docker/docker-py/pull/3016
* docs: add changelog for 6.0.0 by milas in https://github.com/docker/docker-py/pull/3019
* Add sysctl support for docker swarm services by Aadenei in https://github.com/docker/docker-py/pull/3029
* Connect with mac address by YuviGold in https://github.com/docker/docker-py/pull/2481
* docs/css: remove hyphens in literals by jrabbit in https://github.com/docker/docker-py/pull/2452
* Add swarm support for DataPathPort by dexteradeus in https://github.com/docker/docker-py/pull/2987
* test: add additional tests for cgroupns option by milas in https://github.com/docker/docker-py/pull/3024
New Contributors
* hugovk made their first contribution in https://github.com/docker/docker-py/pull/2898
* milas made their first contribution in https://github.com/docker/docker-py/pull/3004
* kmaork made their first contribution in https://github.com/docker/docker-py/pull/2954
* glicht made their first contribution in https://github.com/docker/docker-py/pull/2993
* FrancescoCasalegno made their first contribution in https://github.com/docker/docker-py/pull/2931
* kinday made their first contribution in https://github.com/docker/docker-py/pull/2947
* errorcode7 made their first contribution in https://github.com/docker/docker-py/pull/2910
* avnes made their first contribution in https://github.com/docker/docker-py/pull/2932
* tirkarthi made their first contribution in https://github.com/docker/docker-py/pull/2823
* vilhelmprytz made their first contribution in https://github.com/docker/docker-py/pull/2541
* timgates42 made their first contribution in https://github.com/docker/docker-py/pull/3015
* benfasoli made their first contribution in https://github.com/docker/docker-py/pull/2862
* felixfontein made their first contribution in https://github.com/docker/docker-py/pull/2927
* david0 made their first contribution in https://github.com/docker/docker-py/pull/2930
* PeterDaveHello made their first contribution in https://github.com/docker/docker-py/pull/2828
* till made their first contribution in https://github.com/docker/docker-py/pull/2843
* ercildoune made their first contribution in https://github.com/docker/docker-py/pull/2917
* kalioz made their first contribution in https://github.com/docker/docker-py/pull/2733
* JanoschDeurer made their first contribution in https://github.com/docker/docker-py/pull/2595
* hristog made their first contribution in https://github.com/docker/docker-py/pull/2570
* InnovativeInventor made their first contribution in https://github.com/docker/docker-py/pull/2489
* thomasgassmann made their first contribution in https://github.com/docker/docker-py/pull/2370
* SauravMaheshkar made their first contribution in https://github.com/docker/docker-py/pull/2929
* q0w made their first contribution in https://github.com/docker/docker-py/pull/2920
* n1ngu made their first contribution in https://github.com/docker/docker-py/pull/3028
* Aadenei made their first contribution in https://github.com/docker/docker-py/pull/3029
* jrabbit made their first contribution in https://github.com/docker/docker-py/pull/2452
* dexteradeus made their first contribution in https://github.com/docker/docker-py/pull/2987
**Full Changelog**: https://github.com/docker/docker-py/compare/5.0.3...6.0.0