testcontainers / testcontainers/testcontainers-java

ImageFromDockerfile does not support authenticated pulls

Abierto
#1,799 6 comentarios 0 reacciones 1 asignado Ver en GitHub

@rnorth ya está trabajando en esto.

Desde el 20/12/2019.

resolution/acknowledged type/bug
Lenguaje dominante
Java
Estrellas
8.7k
Forks
1.9k
Merge medio
2 d 17 h
PR fusionados (30 d)
9

Descripción

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.

Guía de contribución

Abrir la guía de contribución

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.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.