Commit Graph

3389 Commits

Author SHA1 Message Date
loicleyendecker 82cf559b5a
volume: do not strip trailing characters from names (#3073)
Only remove `:ro` or `:rw` suffixes in their entirety; do not
strip arbitrary `r` / `o` / `w` / `:` characters individually.

Signed-off-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
2022-12-02 14:48:04 -05:00
Hugo van Kemenade 8590eaad3c
ci: add support for Python 3.11 (#3064)
Signed-off-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-11-15 08:10:56 -05:00
Nick Santos 30022984f6
socket: handle npipe close on Windows (#3056)
Fixes https://github.com/docker/docker-py/issues/3045

Signed-off-by: Nick Santos <nick.santos@docker.com>
2022-11-02 15:31:00 -04:00
Brian Goff bc0a5fbacd
test: use anonymous volume for prune (#3051)
This is related to https://github.com/moby/moby/pull/44216

Prunes will, by default, no longer prune named volumes, only anonymous ones.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-10-05 13:54:45 -04:00
Rhiza 923e067ddd
api: add support for floats to docker logs params since / until (#3031)
Add support for floats to docker logs params `since` / `until` since the
Docker Engine APIs support it.

This allows using fractional seconds for greater precision.

Signed-off-by: Archi Moebius <poerhiz@gmail.com>
2022-08-19 15:10:53 -04:00
Sebastiaan van Stijn 1c27ec1f0c
ci: use latest stable syntax for Dockerfiles (#3035)
I noticed one Dockerfile was pinned to 1.4; given that there's a
backward compatibility guarantee on the stable syntax, the general
recommendation is to use `dockerfile:1`, which makes sure that the
latest stable release of the Dockerfile syntax is pulled before
building.

While changing, I also made some minor changes to some Dockerfiles
to reduce some unneeded layers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-19 15:09:12 -04:00
Milas Bowman 2494d63f36
docs: install package in ReadTheDocs build (#3032)
Need to install ourselves so that we can introspect on version
using `setuptools_scm` in `docs/conf.py`.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-18 17:03:32 -04:00
Milas Bowman e901eac7a8
test: add additional tests for cgroupns option (#3024)
See #2930.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-12 14:27:53 -04:00
Chris Hand fc86ab0d85
swarm: add support for DataPathPort on init (#2987)
Adds support for setting the UDP port used for VXLAN traffic between
swarm nodes

Signed-off-by: Chris Hand <dexteradeus@users.noreply.github.com>
2022-08-12 09:58:57 -04:00
Milas Bowman 45bf9f9115 Merge remote-tracking branch 'upstream/main' into patch-1 2022-08-12 09:43:20 -04:00
Milas Bowman c03aeb659e Merge remote-tracking branch 'upstream/main' into connect-with-mac 2022-08-12 09:21:51 -04:00
Quentin Mathorel 58aa62bb15
swarm: add sysctl support for services (#3029)
Signed-off-by: Quentin Mathorel <quentin.mathorel@outlook.fr>
2022-08-12 08:55:19 -04:00
Milas Bowman ff0b4ac60b
docs: add changelog for 6.0.0 (#3019)
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-11 17:20:13 -04:00
Leonard Kinday 66402435d1
Support `global-job` and `replicated-job` modes in Docker Swarm (#3016)
Add `global-job` and `replicated-job` modes

Fixes #2829.

Signed-off-by: Leonard Kinday <leonard@kinday.ru>
2022-08-11 16:20:31 -04:00
Ningú 42789818be
credentials: eliminate distutils deprecation warnings (#3028)
While removing any usage of the deprecated `distutils` package,
("The distutils package is deprecated and slated for removal in Python 3.12.")
this internal utility can be removed straightaway because the
`shutil.which` replacement for `distutils.spawn.find_executable`
already honors the `PATHEXT` environment variable in windows systems.

See https://docs.python.org/3/library/shutil.html#shutil.which

Signed-off-by: Daniel Möller <n1ngu@riseup.net>
2022-08-02 10:19:50 -04:00
q0w ab5e927300
lint: remove extraneous logic for `preexec_func` (#2920)
`preexec_func` is still None if it is win32

Signed-off-by: q0w <43147888+q0w@users.noreply.github.com>
2022-08-02 10:11:07 -04:00
Saurav Maheshkar b7daa52feb
docs: add `gzip` arg to `BuildApiMixin` (#2929)
Signed-off-by: Saurav Maheshkar <sauravvmaheshkar@gmail.com>
2022-08-02 10:08:24 -04:00
Thomas Gassmann 3f0095a7c1
docs: remove duplicate 'on' in comment (#2370)
Remove duplicate 'on' in comment

Signed-off-by: Thomas Gassmann <thomas.gassmann@hotmail.com>
2022-07-30 12:43:29 -04:00
Milas Bowman 631b332cd9
ci: add missing wheel package
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-30 12:23:53 -04:00
Milas Bowman 7f1bde162f
ci: fix quoting in YAML
Because apparently `!` is special

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-30 12:20:50 -04:00
Milas Bowman cd2c35a9b6
ci: add workflow for releases (#3018)
GitHub Actions workflow to create a release: will upload to PyPI
and create a GitHub release with the `sdist` and `bdist_wheel`
as well.

The version code is switched to `setuptools_scm` to work well
with this flow (e.g. avoid needing to write a script that does
a `sed` on the version file and commits as part of release).

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-30 12:14:27 -04:00
Milas Bowman 828d06f5f5
docs: fix RollbackConfig/Order values (#3027)
Closes #2626.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-30 12:09:36 -04:00
Max Fan dff849f6bb
docs: image build clarifications/grammar (#2489)
I changed was build > was built and reorganized a few sentences to be more clear.

Signed-off-by: InnovativeInventor <theinnovativeinventor@gmail.com>
2022-07-29 16:15:58 -04:00
Hristo Georgiev 52fb27690c
docs: fix image save example (#2570)
Signed-off-by: Hristo Georgiev <hristo.a.georgiev@gmail.com>
2022-07-29 16:04:23 -04:00
Milas Bowman 547cc5794d Merge branch 'docs-healthcheck'
Manually merging #2595 to include a tiny fix.
2022-07-29 16:02:47 -04:00
Milas Bowman 003a16503a docs: fix list formatting
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-29 16:01:29 -04:00
Milas Bowman c6c2bbdcda Merge remote-tracking branch 'upstream/main' into HEAD 2022-07-29 15:56:01 -04:00
Ville Skyttä 73421027be
docs: clarify TLSConfig verify parameter (#2573)
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2022-07-29 15:55:14 -04:00
Ville Skyttä 55f47299c4
docs: fix TLS server verify example (#2574)
Leaving out the verify parameter means verification will not be done.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2022-07-29 15:54:27 -04:00
Clément Loiselet 3ee3a2486f
build: trim trailing whitespace from dockerignore entries (#2733)
fix(dockerignore): trim trailing whitespace

Signed-off-by: Clément Loiselet <clement.loiselet@capgemini.com>
2022-07-29 15:33:23 -04:00
Milas Bowman 868e996269
model: add remove() to Image (#3026)
Allow an Image to be deleted by calling the remove() method on it,
just like a Volume.

Signed-off-by: Ahmon Dancy <dancy@dancysoft.com>
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Ahmon Dancy <dancy@dancysoft.com>
2022-07-29 15:28:16 -04:00
ercildoune 26753c81de
api: add rollback_config to service create (#2917)
`rollback_config` was not in the list of `CREATE_SERVICE_KWARGS`
which prevented it from being an argument when creating services.
It has now been added and the problem fixed, allowing services to
have a rollback_config during creation and updating.

Fixes #2832.

Signed-off-by: Fraser Patten <pattenf00@gmail.com>
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Milas Bowman <milas.bowman@docker.com>
2022-07-29 14:54:55 -04:00
Till! 0031ac2186
api: add force to plugin disable (#2843)
Signed-off-by: till <till@php.net>
2022-07-29 14:51:43 -04:00
Peter Dave Hello b2a18d7209
build: disable pip cache in Dockerfile (#2828)
Signed-off-by: Peter Dave Hello <hsu@peterdavehello.org>
2022-07-29 14:09:06 -04:00
David d69de54d7c
api: add cgroupns option to container create (#2930)
Signed-off-by: David Otto <ottodavid@gmx.net>
2022-07-29 14:04:47 -04:00
Felix Fontein 1a4cacdfb6
api: add platform to container create (#2927)
Add platform parameter for container creation/run

Signed-off-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Milas Bowman <milas.bowman@docker.com>
2022-07-29 13:57:30 -04:00
Milas Bowman 26064dd6b5
deps: upgrade websocket-client to latest (#3022)
* Upgrade websocket-client to latest
* Add basic integration test for streaming logs via websocket

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-29 11:09:47 -04:00
Milas Bowman 05e143429e
api: preserve cause when re-raising error (#3023)
Use `from e` to ensure that the error context is propagated
correctly.

Fixes #2702.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-29 11:08:00 -04:00
Ben Fasoli 23cf16f03a
client: use 12 character short IDs (#2862)
Use 12 characters for Docker resource IDs for
consistency with the Docker CLI.

Signed-off-by: Ben Fasoli <benfasoli@gmail.com>
2022-07-29 09:06:22 -04:00
Milas Bowman ab43018b02
docs: fix markdown rendering (#3020)
Follow instructions at https://www.sphinx-doc.org/en/master/usage/markdown.html.

This switches from `recommonmark` (deprecated) to `myst-parser`
(recommended).

Only impacts the changelog page, which was broken after recent upgrades
to Sphinx for Python 3.10 compatibility.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-28 16:38:57 -04:00
Milas Bowman 9bdb5ba2ba
lint: fix line length violation (#3017)
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-28 11:25:17 -04:00
Milas Bowman be942f8390
deps: upgrade & remove unnecessary dependencies (#3014)
The `requirements.txt` and `setup.py` had a lot of extra transitive
dependencies to try and address various SSL shortcomings from the
Python ecosystem.

Thankfully, between modern Python versions (3.6+) and corresponding
`requests` versions (2.26+), this is all unnecessary now!

As a result, a bunch of transitive dependencies have been removed
from `requirements.txt`, the minimum version of `requests` increased,
and the `tls` extra made into a no-op.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-28 08:32:00 -04:00
Milas Bowman bf026265e0
ci: bump version to 6.0.0-dev (#3013)
It's been a long time without a release, and we've included a
number of fixes as well as raised the minimum Python version,
so a major release seems in order.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-28 08:31:45 -04:00
Tim Gates d2d097efbb
docs: fix simple typo, containe -> container (#3015)
There is a small typo in docker/types/services.py.

Should read `container` rather than `containe`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-07-28 08:30:40 -04:00
Milas Bowman acdafbc116
ci: run SSH integration tests (#3012)
Fix & enable SSH integration test suite.

This also adds a new test for connecting to unknown hosts when
using the Python SSH implementation (Paramiko). See #2932 for
more info.

Because of the above, some of the config/static key files have been
moved around and adjusted.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-27 16:25:27 -04:00
Vilhelm Prytz ea4cefe4fd
lint: remove unnecessary pass statements (#2541)
Signed-off-by: Vilhelm Prytz <vilhelm@prytznet.se>
2022-07-27 15:31:04 -04:00
Karthikeyan Singaravelan adf5a97b12
lint: fix deprecation warnings from threading package (#2823)
Set `daemon` attribute instead of using `setDaemon` method that
was deprecated in Python 3.10.

Signed-off-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2022-07-27 15:25:11 -04:00
Audun V. Nes d9298647d9
ssh: reject unknown host keys when using Python SSH impl (#2932)
In the Secure Shell (SSH) protocol, host keys are used to verify the identity of remote hosts. Accepting unknown host keys may leave the connection open to man-in-the-middle attacks.

Do not accept unknown host keys. In particular, do not set the default missing host key policy for the Paramiko library to either AutoAddPolicy or WarningPolicy. Both of these policies continue even when the host key is unknown. The default setting of RejectPolicy is secure because it throws an exception when it encounters an unknown host key.

Reference: https://cwe.mitre.org/data/definitions/295.html

NOTE: This only affects SSH connections using the native Python SSH implementation (Paramiko), when `use_ssh_client=False` (default). If using the system SSH client (`use_ssh_client=True`), the host configuration
(e.g. `~/.ssh/config`) will apply.

Signed-off-by: Audun Nes <audun.nes@gmail.com>
2022-07-27 15:01:41 -04:00
errorcode bb40ba051f
ssh: do not create unnecessary subshell on exec (#2910)
Signed-off-by: liubo <liubo@uniontech.com>
2022-07-27 14:57:26 -04:00
Milas Bowman 52e29bd446
deps: remove backports.ssl_match_hostname (#3011)
This is no longer needed as it exists in every supported (non-EOL)
version of Python that we target.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-27 14:44:50 -04:00