testcontainers / testcontainers/testcontainers-python
Feature: A way to construct a `Network` object for an existing docker network
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.3k
- Fork
- 386
- Merge trung bình
- 4 giờ 40 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với core/testcontainers/core/network.py, xung quanh thuộc tính name của Network, và kiểm tra DockerContainer.with_network. Xác định cách biểu diễn tên của một network hiện có mà không tạo hoặc quản lý network đó, sau đó xác minh rằng một DockerContainer có thể kết nối với network đó khi được khởi động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, python
- Lĩnh vực
- devops, infrastructure
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100