Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Give reusable containers a stable identity and a way to prune them

Đang mở
#1,552 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, node.js, typescript
Lĩnh vực
devtools, testing

Hướng nghiên cứu

Start by reading reuseOrStartContainer in packages/testcontainers/src/generic-container/generic-container.ts and createLabels in packages/testcontainers/src/utils/labels.ts, then review dependency issue #1522 to understand the shared reuse hash decision. The issue also calls for an optional reuse key and a prune API plus command; define how replacement handles containers used by another process. Done means identity stays stable across library upgrades, keyed configuration changes replace the old reusable container, and users can list or prune reusable containers.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement minor

What happens

A reusable container lives until someone removes it by hand, and the library gives no help with that.

  • The reuse hash includes the org.testcontainers.version label, so every library upgrade changes the hash of every reusable container. The old ones are never matched again and keep running.
  • Any change to a container's configuration has the same effect: a new container appears next to the old one.
  • There is no API or command to list or remove reusable containers. The way to find them is docker ps --filter label=org.testcontainers.container-hash.

Expected

  • The library version is not part of a reusable container's identity.
  • An optional explicit key, withReuse({ key: "orders-db" }). A container with the same key and a different configuration is replaced instead of joined by a second one.
  • A way to clean up: TestContainers.pruneReusableContainers() and a matching command.

Where

  • reuseOrStartContainer in packages/testcontainers/src/generic-container/generic-container.ts
  • createLabels in packages/testcontainers/src/utils/labels.ts

Notes

  • Go has WithReuseByName(containerName).
  • Decide what "replace" means for a container another process is still using.

Dependencies

  • Stack on #1522: both redefine what goes into the reuse hash. Decide the contents once.
Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
274
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-node

Tất cả issue của testcontainers/testcontainers-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.