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

Add pluggable image name substitution

Aperta
#1,570 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, typescript

Direzione di ricerca

Start with packages/testcontainers/src/container-runtime/image-name.ts and trace how ImageName is built for Ryuk and SSHD. The issue leaves the scope of Compose images and Dockerfile FROM lines undecided, and depends on configuration work in #1569. Done means image pulls pass through the configured substitutor, with the existing prefix variable as the default.

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

Descrizione

enhancement minor

What happens

The only way to redirect image pulls is TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX, which prefixes Docker Hub image names. It cannot:

  • map other registries (ghcr.io, quay.io, mcr.microsoft.com) to a mirror
  • apply different rules to different images
  • rewrite a tag or a digest

Organisations that mirror everything through an internal registry end up editing image names in every test.

Expected

A function that every image name passes through before it is pulled, registered in configuration:

TestContainers.configure({
  imageNameSubstitutor: (image) => (image.registry === "ghcr.io" ? image.withRegistry("mirror.example.com/ghcr") : image),
});

The existing prefix variable becomes the default substitutor.

Where

  • packages/testcontainers/src/container-runtime/image-name.ts
  • the places that build ImageName for Ryuk and SSHD

Notes

  • Java has a pluggable ImageNameSubstitutor, with PrefixingImageNameSubstitutor as the built-in equivalent of the prefix variable. Go has WithImageSubstitutors.
  • Decide whether images named in Compose files and Dockerfile FROM lines are in scope.

Dependencies

  • Blocked by #1569: the substitutor is registered through configuration.
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.