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

Start a group of containers with dependencies and shared cleanup

Abierto
#1,565 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
42/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

Read the existing GenericContainer and Network implementations under packages/testcontainers/src, then inspect how container startup and cleanup are handled. Design the group API from the issue’s sketch, including dependency ordering, parallel starts, shared network aliases, and stopping containers if a start fails; done means the group can start and dispose of a set of containers as described.

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

Descripción

enhancement minor

What happens

A test that needs several containers wires them up by hand:

const network = await new Network().start();
const db = await new PostgreSqlContainer(dbImage).withNetwork(network).withNetworkAliases("db").start();
const app = await new GenericContainer(appImage)
  .withNetwork(network)
  .withEnvironment({ DATABASE_URL: "postgres://test:test@db:5432/test" })
  .withExposedPorts(8080)
  .start();
// ...
await app.stop();
await db.stop();
await network.stop();
  • Start order is whatever order the awaits are written in. Independent containers start one after another unless the test adds its own Promise.all.
  • With Promise.all, if one start() rejects the others keep running until Ryuk removes them at process exit.
  • Cleanup is one call per container, in the right order.

Expected

A way to declare a set of containers, their dependencies and a shared network, start them as a unit and dispose of them as a unit:

await using group = await new ContainerGroup()
  .with("db", new PostgreSqlContainer(dbImage))
  .with("app", new GenericContainer(appImage).withExposedPorts(8080), { dependsOn: ["db"] })
  .start();

const app = group.get("app");
  • Containers without a dependency between them start in parallel.
  • Each name becomes a network alias on a network the group owns.
  • If any container fails to start, the ones already started are stopped.

Where

New code in packages/testcontainers/src, built on GenericContainer and Network.

Notes

  • Java has dependsOn(Startable...) on containers and Startables.deepStart(...) for parallel start.
  • DockerComposeEnvironment covers this when the setup lives in a compose file. This is for setups defined in code, including module containers.
  • The API shape above is a sketch.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1536: a group puts its containers on a network with aliases.
  • Coordinate with #1520: a group starts builders it was handed, so start() must not change them.
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.