Skip to content

Commit

Permalink
Docker: Handle container create kwargs properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ogajduse authored and JacobCallahan committed Jul 10, 2024
1 parent 094b0f6 commit c06bf83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions broker/binds/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def __init__(self, port=2375, **kwargs):
self.uri = "ssh://{username}@{host}".format(**kwargs)

def _sanitize_create_args(self, kwargs):
from docker.models.containers import RUN_CREATE_KWARGS
from docker.models.containers import RUN_CREATE_KWARGS, RUN_HOST_CONFIG_KWARGS

return {k: v for k, v in kwargs.items() if k in RUN_CREATE_KWARGS}
special_kwargs = ["ports", "volumes", "network", "networking_config"]
accepted_kwargs = RUN_HOST_CONFIG_KWARGS + RUN_CREATE_KWARGS + special_kwargs
return {k: v for k, v in kwargs.items() if k in accepted_kwargs}

0 comments on commit c06bf83

Please sign in to comment.