I’m using the new feature where depends_on has condition to wait for successful service completion (introduced in Compose 1.29.0).
However, I still can’t find the feature in the documentation of any of the existing Compose file versions (which is up to version 3.8). So I suppose this means that version: '3.8' is insufficient?
According to this post, 3.9 also exists but is still (now almost a full year after that post!) not documented. Also, the depends_on feature is also added after 3.9 was “specified” so should I really be using version: '3.10'?
So docker finaly implemented something like the kubernetes init containers for docker-compose?
I am uncertain why they still even support and maintain depends_on, as it’s only an option for “plain” docker-compose deployments, but not for swarm stack deployments.
As soon as you start to use swarm services, you will need to implement “precondtion checks” in your entrypoint script that wait for certain preconditions become true, as `depends_on’ declarations are ignored in swarm stack deployments.
@bisgardo are you getting a specific error message? I stumbled accross a github issue where people wrote it works ootb with the current release - though they didn’t mention a specific schema versions. Just give it a try with docker config and see if docker-compose complains, if it does try to raise the schema version until it does not complain
Should have been docker-compose config instead of docker config.
I like to use it to let docker-compose verify the compose file and render the output to the screen.