Enhance healthcheck
blocking dependent
behavior like lifecyle
#10580
Labels
healthcheck
blocking dependent
behavior like lifecyle
#10580
Description
Problem
I found
postgres
image can't block dependent startup, which makedependent
start up too early.Actual
If
dependent
acceptclient
at early time,dependent
failed.Expected
After
postgres
ready,dependent
should not startup and acceptclient
.Try
Add
/docker-entrypoint-initdb.d/wait.sh
, which does not block dependent.Overwrite command, which does not block dependent.
Besides, when overwrite entry/command, sometimes you may need to know what is the original entry/command, and call these HARD CODED command in a very ugly way.
https://stackoverflow.com/questions/31746182/docker-compose-wait-for-container-x-before-starting-y
I found
.depends_on.X.condition
works, but not very graceful to solvewait-for-container-x-before-starting-y
.If
.interval
big, run.healthcheck.test
late, startdependent
late, not very ideal.If
.interval
small, run.healthcheck.test
too many times, not very graceful.Workaround
Below is my workaround.
Feat
Above workaround I still don't think very ideal, so I opened a feat.
Enhance
healthcheck
behavior like lifecyle.Related
Execute a command after run #1809
Proposal: docker-compose events #1510
Additional
Are there lifecyle support within container ecosystem?
Yes, vscode
devcontainer
support lifecycle.https://github.com/devcontainers/spec/blob/main/schemas/devContainerFeature.schema.json#L106-L206
initializeCommand
onCreateCommand
updateContentCommand
postCreateCommand
postStartCommand
postAttachCommand
The text was updated successfully, but these errors were encountered: