Add an escape hatch for raw container create options
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, typescript
Línea de trabajo
Read packages/testcontainers/src/generic-container/generic-container.ts and packages/testcontainers/src/test-container.ts, then trace where start() builds the Docker create request. Add the documented builder modifier so it runs last and works for modules; account for its output in the reuse hash as required by #1522, coordinating with #1520. Done when the modifier can set raw create options and the reuse hash reflects them.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
A Docker create option that has no with* method can only be set by subclassing GenericContainer and writing to the protected createOpts or hostConfig:
class SysctlContainer extends GenericContainer {
constructor(image: string) {
super(image);
this.hostConfig.Sysctls = { "net.core.somaxconn": "1024" };
}
}
Options in this position today include Sysctls, Dns, Devices, ReadonlyRootfs, RestartPolicy, Init, PidMode and StopSignal. Each one otherwise needs a feature request and a release.
It also cannot be done for a module container without subclassing the module.
Expected
A documented escape hatch on the builder:
new GenericContainer(image).withCreateOptions((options) => {
options.HostConfig.Sysctls = { "net.core.somaxconn": "1024" };
});
It runs last, after the library has built the request, and works on any container including modules.
Where
packages/testcontainers/src/generic-container/generic-container.tspackages/testcontainers/src/test-container.ts
Notes
- Java has
withCreateContainerCmdModifier(Consumer<CreateContainerCmd>). Go hasConfigModifier,HostConfigModifierandEndpointSettingsModifieron the request, and has deprecated several dedicated fields in their favour. - This exposes Dockerode's types on purpose, in one clearly marked place. With an escape hatch, subclasses no longer need the protected
createOptsandhostConfigfields. - The modifier's result must be part of the reuse hash (#1522).
Dependencies
- Stack on #1520: the modifier runs where
start()builds the create request, which that issue reworks. - Coordinate with #1522: the modifier's output has to be part of the reuse hash.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.6k
- Forks
- 274
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 44
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de testcontainers/testcontainers-node
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
testcontainers/testcontainers-node#1539 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
testcontainers/testcontainers-node#1533 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
testcontainers/testcontainers-node#1531 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
testcontainers/testcontainers-node#1529 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
testcontainers/testcontainers-node#1528 ·
Los mantenedores suelen responder en 1 día
Todos los issues de testcontainers/testcontainers-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pnpm/get.pnpm.io#68 ·
-
[BUG] Cloudflare KV binding 模式下 kvDriver.list() 沿用 EdgeOne 语义,字段名不匹配导致 key 格式下初始化 500 并耗尽 list 配额Posiblemente ocupada @wumingzhinu la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
OpenListTeam/OpenList-Worker#125 ·
Los mantenedores suelen responder en 2 días
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
margelo/react-native-vision-camera#4217 ·
Los mantenedores suelen responder en 4 días