Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,552 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, node.js, typescript
Área
devtools, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
2.6k
Forks
274
Merge medio
1 d 14 h
PR fusionados (30 d)
44

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de testcontainers/testcontainers-node

Todos los issues de testcontainers/testcontainers-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.