testcontainers / testcontainers/testcontainers-java

ImageFromDockerfile does not support authenticated pulls

Aperta
#1,799 6 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@rnorth ci sta già lavorando.

Dal 20/12/2019.

resolution/acknowledged type/bug
Lingua principale
Java
Stelle
8.7k
Fork
1.9k
Merge medio
2g 17h
PR unite (30g)
9

Descrizione

ImageFromDockerfile doesn't work if base layer(s) need to be pulled from an authenticated registry and if those images are not already pulled.

For example:

# Dockerfile
FROM my.authenticated.registry/somerepo/someimage

will result in a failure at image build time, even if the user has working credentials available on their machine (for example, a CLI docker pull or docker build works).

It looks like BuildImageCmd's withBuildAuthConfigs(AuthConfigurations); gives us an opportunity to improve this - however we'd have to perform a lookup for credentials for each image first.

I think it should be feasible to:

  • do a minimal parse of the Dockerfile to extract any FROM x [--as=y] declarations
  • run each image name found through RegistryAuthLocator and obtain an auth configuration for each registry
  • provide the auth configurations to BuildImageCmd

The main difficulty would be that we have a few different ways in which the Dockerfile flows through Testcontainers, so we'd need to make sure we capture Dockerfile content at the right time.

Guida per i contributori

Apri la guida per i contributori

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.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.