From 37333c8fe86884e6b334fca1fcceb967581e54a4 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 14 Mar 2017 20:38:59 -0400 Subject: [PATCH] Fix depends_on in Compose file v3 reference (#2278) * docker swarm does not respect depends_on Swarmkit does not seem to have the concept of starting services in a particular order. Tested with docker 1.13.1. Also, `docker-compose bundle` warns us about depends_on being unsupported. * Remove condition form of depends_on from the V3 compose file docs. Signed-off-by: Daniel Nephin --- compose/compose-file/index.md | 43 ++++++++++------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/compose/compose-file/index.md b/compose/compose-file/index.md index 5346695809..46d6a84630 100644 --- a/compose/compose-file/index.md +++ b/compose/compose-file/index.md @@ -343,38 +343,19 @@ Simple example: db: image: postgres -> **Note:** `depends_on` will not wait for `db` and `redis` to be "ready" before -> starting `web` - only until they have been started. If you need to wait -> for a service to be ready, see [Controlling startup order](/compose/startup-order.md) -> for more on this problem and strategies for solving it. +> **Note:** There are several things to be aware of when using `depends_on`: +> +> - `depends_on` will not wait for `db` and `redis` to be "ready" before +> starting `web` - only until they have been started. If you need to wait +> for a service to be ready, see [Controlling startup order](/compose/startup-order.md) +> for more on this problem and strategies for solving it. +> +> - Version 3 no longer supports the `condition` form of `depends_on`. +> +> - The `depends_on` option is ignored when +> [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) +> with a version 3 Compose file. -A healthcheck indicates you want a dependency to wait -for another container to be "healthy" (i.e. its healthcheck advertises a -successful state) before starting. - -Example: - - version: '2.1' - services: - web: - build: . - depends_on: - db: - condition: service_healthy - redis: - condition: service_started - redis: - image: redis - db: - image: redis - healthcheck: - test: "exit 0" - -In the above example, Compose will wait for the `redis` service to be started -(legacy behavior) and the `db` service to be healthy before starting `web`. - -See the [healthcheck section](#healthcheck) for complementary -information. ### dns