Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuarkusIntegrationTest docker run, does not pull the image #17730

Closed
bdevreugd-vialis opened this issue Jun 7, 2021 · 3 comments · Fixed by #17753
Closed

QuarkusIntegrationTest docker run, does not pull the image #17730

bdevreugd-vialis opened this issue Jun 7, 2021 · 3 comments · Fixed by #17753

Comments

@bdevreugd-vialis
Copy link
Contributor

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:

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:

List<String> args = new ArrayList<>();
args.add("docker"); // TODO: determine this dynamically?
args.add("run");

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

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 7, 2021

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Jun 7, 2021

Good point!

@geoand
Copy link
Contributor

geoand commented Jun 7, 2021

I'll actually make the pull conditional on whether or not the image was only pushed

geoand added a commit to geoand/quarkus that referenced this issue Jun 8, 2021
geoand added a commit that referenced this issue Jun 8, 2021
Pull docker image when necessary for @QuarkusIntegrationTest
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 8, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final Jun 10, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants