Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add programmatic configuration

Aperta
#1,569 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
2.6k
Fork
274
Merge medio
1g 14h
PR unite (30g)
44

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testcontainers/testcontainers-node

Tutte le issue di testcontainers/testcontainers-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.