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

Add programmatic configuration

Đang mở
#1,569 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
45/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
tooling

Hướng nghiên cứu

Start with packages/testcontainers/src/test-containers.ts and packages/testcontainers/src/testcontainers-runtime/strategies/utils/config.ts, then trace the listed process.env reads in the reaper, port forwarder, image name, generic container and auth paths. Define how configuration is resolved alongside environment variables and the properties file, including precedence and changes after runtime initialization. Done means TestContainers.configure() and getConfiguration() provide typed effective settings while existing configuration sources continue to work.

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

Configuration comes only from environment variables and .testcontainers.properties, and each setting is read where it is used. Fourteen variables are read through process.env across packages/testcontainers/src (Ryuk image, port, privileged, verbose and disabled flags, the SSHD image and port, the hub image prefix, reuse, Docker auth config and others), plus the Docker host settings in the strategy config.

  • Changing a setting from code means assigning to process.env before the first container starts.
  • Nothing is typed or validated. A misspelt variable is silently ignored.
  • There is no way to read the effective configuration.

Expected

A typed configuration object with one place that resolves it:

TestContainers.configure({
  ryuk: { disabled: false, privileged: true },
  hubImageNamePrefix: "registry.example.com/mirror",
  reuse: { enabled: true },
});
  • Environment variables and the properties file keep working, with a documented precedence.
  • TestContainers.getConfiguration() returns what is in effect.

Where

  • packages/testcontainers/src/container-runtime/strategies/utils/config.ts
  • the process.env reads in reaper/reaper.ts, port-forwarder/port-forwarder.ts, container-runtime/image-name.ts, generic-container/generic-container.ts and container-runtime/auth/
  • packages/testcontainers/src/test-containers.ts

Notes

  • Java centralises this in TestcontainersConfiguration.
  • Configuration must be set before the runtime client and Ryuk are created. Decide what happens when it is changed afterwards.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1568: the logger is a natural configuration setting.
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.