Support all Network.connect parameters in client.containers.run and client.containers.create#3121
Support all Network.connect parameters in client.containers.run and client.containers.create#3121milas merged 8 commits intodocker:mainfrom Skazza94:main
Network.connect parameters in client.containers.run and client.containers.create#3121Conversation
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
|
Hi all, We are waiting for it for a long time 😇 |
|
Hi, Since last release was in June, I think that it is not productive for anyone to wait so long for a new feature to be merged/released in Please, take this as constructive criticism. We extensively use Thanks, |
milas
left a comment
There was a problem hiding this comment.
Thanks for this PR and your prior contributions. Having this sit around for so long is unfortunate; if you're still interested I would love to help get this merged and we can do a v7 release along with a few other changes.
Overall it looks good, I'd just like to re-use the EndpointConfig type and make sure we are able to support multiple networks as part of container create.
docker/models/containers.py
Outdated
| to the network driver. Defaults to ``None``. Used in | ||
| conjuction with ``network``. Incompatible | ||
| with ``network_mode``. | ||
| network_config (dict): A dictionary containing options that are |
There was a problem hiding this comment.
There is an EndpointConfig type:
docker-py/docker/types/networks.py
Lines 5 to 8 in c38656d
Newer versions of the Moby API (will) allow defining multiple networks on create, so let's keep this the same here, e.g. Dict[str, EndpointConfig], so that we don't have to update this again / make another breaking change.
(I'm ok with this breaking change to replace network_driver_opt since it was just introduced in v6, so it is hopefully not that entrenched in codebases yet.)
- Renamed parameter from `network_config` to `networking_config` to be more semantically correct with the rest of the API.
|
Hi @milas, I've made the requested changes. The parameter has now been updated to be of type Furthermore, I have renamed the new parameter to Let me know if you require any other change. Thanks, |
|
Thanks again for making the changes and apologies with how long this took to get merged. I'm going to get Python 3.12 compatibility fixed and release a 7.0.0 ASAP |
In PR #3083, I introduced the support for the
network_driver_optparameter inclient.containersrunandcreate.This PR will further extend this support, by adding all the parameters of
Network.connectto the aforementioned methods.I changed the methods signature a bit, removing the
network_driver_optsparameter and adding a dict callednetwork_configthat supports all the parameters.I would kindly request if it possible to release a newer version of dockerpy with this feature merged soon, since I need it to continue developing some Kathará features. Thanks.