testcontainers / testcontainers/testcontainers-python
Feature: A way to construct a `Network` object for an existing docker network
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 2.3k
- Forks
- 386
- Merge medio
- 4 h 40 min
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con core/testcontainers/core/network.py, alrededor de la propiedad name de Network, e inspecciona DockerContainer.with_network. Determina cómo se puede representar el nombre de una red existente sin crear ni gestionar la red y, a continuación, verifica que un DockerContainer pueda conectarse a ella al iniciarse.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, python
- Área
- devops, infrastructure
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100