question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wait/healthy ignored since 0.26.1

See original GitHub issue

The healthy condition seems to be ignored if the image is not build, and only started. (The image already has a defined healthcheck).

The same pom.xml results in different behavior:

[INFO] --- docker-maven-plugin:0.26.1:start (mysql) @ assembly ---
[INFO] DOCKER> [psb/mysql:skyblue-dump] "psb-mysql": Start container 1c89f832ad3f
[INFO] DOCKER> [psb/mysql:skyblue-dump] "psb-mysql": Pausing for 40000 ms

vs.

[INFO] --- docker-maven-plugin:0.26.0:start (psb-all) @ assembly ---
[INFO] DOCKER> [psb-all:latest] "psb-all": Start container 149f1ddc9a25
[INFO] DOCKER> [psb-all:latest] "psb-all": Waiting to become healthy

We have another image that is being built and then started. There the healthy condition is properly checked

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jakub-bochenskicommented, Oct 2, 2018

Actually it seems that even adding an empty build section works:

                      <build />

result:

[INFO] --- docker-maven-plugin:0.26.1:start (mysql) @ assembly ---
[INFO] DOCKER> [psb/mysql:skyblue-dump] "psb-mysql": Start container 223c24061cde
[INFO] DOCKER> [psb/mysql:skyblue-dump] "psb-mysql": Waiting to become healthy
0reactions
zonia3000commented, Feb 7, 2022

Hi, I encountered the issue on a very complicated pom.xml. I tried to create a simplified example and having a cleaner log output I understood better what happened, at least on my case. So, at the moment I’m not sure if this can be considered a bug or it is the expected behavior.

I was trying to create a condition that wait on both the port and the healthy status.

The plugin says “Waited on tcp port ‘[/172.17.0.2:80]’ and on healthcheck”, however what it is really doing is applying an or condition. If this is the expected behavior I think it should be at least clarified in the documentation.

Here you can find a simplified example: https://github.com/zonia3000/fabric8-issue-1101 The customized container becomes healthy after 15s, but the port is immediately available.

In my use case the pom.xml configuration for the plugin is reused for different images (the image name is passed as a property, according to the selected maven profile), so I don’t know if I need to wait on the healthcheck or on the port. I would like to have this dynamically configurable and if I specify <healthy>true</healthy> it should wait for the healthy status, even if the port is already available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker-maven-plugin - Bountysource
The healthy condition seems to be ignored if the image is not build, and only started. (The image already has a defined healthcheck)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found