-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support all Network.connect
parameters in client.containers.run
and client.containers.create
#3121
Conversation
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an EndpointConfig
type:
docker-py/docker/types/networks.py
Lines 5 to 8 in c38656d
class EndpointConfig(dict): | |
def __init__(self, version, aliases=None, links=None, ipv4_address=None, | |
ipv6_address=None, link_local_ips=None, driver_opt=None, | |
mac_address=None): |
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_opt
parameter inclient.containers
run
andcreate
.This PR will further extend this support, by adding all the parameters of
Network.connect
to the aforementioned methods.I changed the methods signature a bit, removing the
network_driver_opts
parameter and adding a dict callednetwork_config
that 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.