testcontainers / testcontainers/testcontainers-java
ImageFromDockerfile does not support authenticated pulls
@rnorth arbeitet bereits daran.
Seit 20.12.2019.
- Vorherrschende Sprache
- Java
- Sterne
- 8.7k
- Forks
- 1.9k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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
RegistryAuthLocatorand 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.