Add an escape hatch for raw container create options
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.6k
- Fork
- 274
- Merge medio
- 1g 14h
- PR unite (30g)
- 44
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testcontainers/testcontainers-node
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
testcontainers/testcontainers-node#1539 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
testcontainers/testcontainers-node#1533 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
testcontainers/testcontainers-node#1531 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
testcontainers/testcontainers-node#1529 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
testcontainers/testcontainers-node#1528 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di testcontainers/testcontainers-node
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
one-zero-eight/apply-bot#39 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bigbluebutton/bbb-ui-components-react#108 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
high priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 commento ·