Feature: A way to construct a `Network` object for an existing docker network
What are you trying to do?
Attach a DockerContainer to an existing network. In my specific case, the network was created as part of a composable setup, and I'd like to attach a new container to that network.
Why should it be done this way?
I suppose my suggestion would be a way to construct a Network object by simply passing the name in as an argument. Best I can tell that name property is all that is really needed when the DockerContainer is started.
A perhaps easier way might be to create a new class
class ExistingNetwork:
def __init__(self, network_name: str):
self.name = network_name
While this I think could be passed into DockerContainer.with_network & it seems to work, it might be better to have this inherit Network and explicitly override the other methods in the Network class to ensure they are not called.