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

Make stopped containers restartable, or drop the empty stopped types

Đang mở
#1,541 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
56/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả 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 with the listed stopped container and Docker Compose environment files, then trace how stop() and down() construct and return these objects. Compare those paths with the expected restart and removal behavior, including wait strategy handling. Done means the stopped states support the requested lifecycle operations or the empty marker types are removed or documented, with tests covering the chosen behavior.

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

stop(), down() and Network.stop() return a "stopped" object, but those objects do very little:

Type Members
StoppedTestContainer getId(), copyArchiveFromContainer()
StoppedNetwork none
StoppedDockerComposeEnvironment down()
DownedDockerComposeEnvironment none

After container.stop({ remove: false }) the container still exists, but the returned object cannot start it again or remove it. Doing either means dropping to getContainerRuntimeClient() and Dockerode. The same goes for a Compose environment after stop(): it can be taken down but not brought back up.

Expected

Either the stopped states become useful, or the empty ones go away:

  • StoppedTestContainer gains start() (returning a started container, with wait strategy applied) and remove().
  • StoppedDockerComposeEnvironment gains a way to start again.
  • StoppedNetwork and DownedDockerComposeEnvironment are replaced by Promise<void>, or documented as markers.

Where

  • packages/testcontainers/src/test-container.ts
  • packages/testcontainers/src/generic-container/stopped-generic-container.ts
  • packages/testcontainers/src/network/network.ts
  • packages/testcontainers/src/docker-compose-environment/stopped-docker-compose-environment.ts
  • packages/testcontainers/src/docker-compose-environment/downed-docker-compose-environment.ts

Notes

  • Go's container has Start, Stop and Terminate on one type, so a stopped container can be started again.
  • Adding methods is minor. Removing the empty classes would be major.

Dependencies

  • Nothing blocks this. It can start now.
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.