snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

QuarkusIntegrationTest docker run, does not pull the image #357

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

In our CI-build the docker image is pushed to nexus using jib, the integration-test is then run on a docker daemon. The first time it will correctly pull the image (which sometimes causes a timeout, because it is not within the 10 seconds wait period:

https://github.com/quarkusio/quarkus/blob/11607b626f070f5ed92617e3273322b30de6822d/test-framework/common/src/main/java/io/quarkus/test/common/LauncherUtil.java#L68

The second time (and all tries after that), it will reuse the docker image inside the docker daemon!

Basically, it should pull the image first and after that run the image. I know there is an option called --pull=always on run, but that doesn't work on older docker daemons.

So basically something like:

List<String> args = new ArrayList<>();
args.add("docker");
args.add("pull");
args.add(containerImage);
ProcessBuilder(args).redirectError(logFile.toFile()).redirectOutput(logFile.toFile()).start().waitFor();

Before the actual docker run here: https://github.com/quarkusio/quarkus/blob/11607b626f070f5ed92617e3273322b30de6822d/test-framework/common/src/main/java/io/quarkus/test/common/DockerContainerLauncher.java#L71-L73

This will also fix the timeout if the pull on the first run takes to long.


https://github.com/quarkusio/quarkus/issues/17730


$upstream:17730$