testcontainers / testcontainers/testcontainers-java
Error when pulling testcontainers/ryuk not enough explicit
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 8.7k
- Forks
- 1.9k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 9
Descripción
Hello,
I finally understood an error that I had for a long time. In fact, when using testcontainers on computers accessing internet through a specific corporate proxy I had the error below. But I could not understand why testcontainers was trying to access the docker hub as I specifically specified an image in my own private registry.
What I've just understood is that testcontainers first tries to download the testcontainers/ryuk image (from docker hub). But the error below does not mention "testcontainers/ryuk" so I had no idea.
My request is to improve the logs so that people know at least what image is being pulled. Moreover, I can imagine that I will face the error next time testcontiners is upgraded and requires a new version of testcontainers/ryuk ! I hope I will remember the solution ;)
For the record, if people have the same error, you can avoid it by:
- configuring the TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX env variable to point to your private registry
- publish the testcontainers/ryuk image to your own registry with those commands:
docker pull testcontainers/ryuk:0.3.0
docker tag testcontainers/ryuk:0.3.0 harbor.xxx/third-parties/testcontainers/ryuk:0.3.0
docker push harbor.xxx/third-parties/testcontainers/ryuk:0.3.0
Here are the original logs, not very clear:
17:47:50.872 INFO [main] (DockerClientProviderStrategy.java:158) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
17:47:50.914 INFO [main] (DockerClientFactory.java:180) Docker host IP address is 172.17.0.1
17:47:50.950 INFO [main] (DockerClientFactory.java:192) Connected to docker:
Server Version: 1.13.1
API Version: 1.26
Operating System: CentOS Linux 7 (Core)
Total Memory: 19916 MB
17:47:50.961 INFO [main] (ImageNameSubstitutor.java:50) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
17:47:51.109 INFO [docker-java-stream-1335806995] (LoggedPullImageResultCallback.java:38) Starting to pull image
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.012 s <<< FAILURE! - in com.xxx.container.ContainerCheckerTest
[ERROR] test(com.xxx.container.ContainerCheckerTest) Time elapsed: 3.005 s <<< ERROR!
com.github.dockerjava.api.exception.DockerClientException: Could not pull image: Get https://registry-1.docker.io/v2/: x509: certificate signed by unknown authority
at com.github.dockerjava.api.command.PullImageResultCallback.checkDockerClientPullSuccessful(PullImageResultCallback.java:97)
at com.github.dockerjava.api.command.PullImageResultCallback.throwFirstError(PullImageResultCallback.java:112)
at com.github.dockerjava.api.async.ResultCallbackTemplate.awaitCompletion(ResultCallbackTemplate.java:93)
at org.testcontainers.images.TimeLimitedLoggedPullImageResultCallback.awaitCompletion(TimeLimitedLoggedPullImageResultCallback.java:52)
at org.testcontainers.DockerClientFactory.checkAndPullImage(DockerClientFactory.java:334)
at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:93)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:205)
at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Lee DockerClientFactory.java alrededor de checkAndPullImage y ResourceReaper.java alrededor de start; después, inspecciona LoggedPullImageResultCallback.java. Reproduce el fallo de ContainerCheckerTest y sigue la operación de pull. La tarea estará terminada cuando los errores relacionados con pull identifiquen claramente la imagen solicitada y el comportamiento actual de las pruebas se mantenga intacto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, java
- Área
- devops, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100