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

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

Aperta
#1,552 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
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
devtools, testing

Direzione di ricerca

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.

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

Descrizione

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.
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.