wait/healthy ignored since 0.26.1
See original GitHub issueThe 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:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually it seems that even adding an empty build section works:
result:
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.