Skip to content

Commit 60bfea8

Browse files
authored
Guides: compose dependencies / long-option (#3611)
Docker compose's "short" `depends_on` syntax (just mentioning the dependent service) does not assert on the expected condition (`service_healthy` or `service_completed_successfully`). This can lead to services being started too early, although their dependencies are not in the expected state. This change updates the affected parts to use the "long" syntax.
1 parent c79a94e commit 60bfea8

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

getting-started/ceph/docker-compose.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ services:
6161
volumes:
6262
- ./ceph-conf:/etc/ceph
6363
depends_on:
64-
- mon1
64+
mon1:
65+
condition: service_started
6566
ports:
6667
- ${DASHBOARD_PORT}:${INTERNAL_DASHBOARD_PORT}
6768

@@ -93,7 +94,8 @@ services:
9394
- ./ceph-conf:/etc/ceph
9495
- ./bootstrap-osd:/var/lib/ceph/bootstrap-osd
9596
depends_on:
96-
- mon1
97+
mon1:
98+
condition: service_started
9799

98100
rgw1:
99101
image: quay.io/ceph/ceph:v20.2.0
@@ -125,7 +127,8 @@ services:
125127
volumes:
126128
- ./ceph-conf:/etc/ceph
127129
depends_on:
128-
- osd1
130+
osd1:
131+
condition: service_started
129132
healthcheck:
130133
test: ["CMD", "curl", "--fail", "http://localhost:7480"]
131134
interval: 2s
@@ -161,7 +164,8 @@ services:
161164
# Optional, allows attaching a debugger to the Polaris JVM
162165
- "5005:5005"
163166
depends_on:
164-
- rgw1
167+
rgw1:
168+
condition: service_started
165169
environment:
166170
JAVA_DEBUG: true
167171
JAVA_DEBUG_PORT: "*:5005"

getting-started/minio/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ services:
8989
depends_on:
9090
polaris:
9191
condition: service_healthy
92+
setup_bucket:
93+
condition: service_completed_successfully
9294
environment:
9395
- CLIENT_ID=root
9496
- CLIENT_SECRET=s3cr3t

getting-started/quickstart/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ services:
5252
depends_on:
5353
rustfs:
5454
condition: service_healthy
55+
bucket-setup:
56+
condition: service_completed_successfully
5557
environment:
5658
JAVA_DEBUG: true
5759
JAVA_DEBUG_PORT: "*:5005"

getting-started/telemetry/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ services:
7878
depends_on:
7979
polaris:
8080
condition: service_healthy
81+
polaris-setup:
82+
condition: service_completed_successfully
8183
volumes:
8284
- ../assets/prometheus/:/etc/prometheus/
8385
command:

0 commit comments

Comments
 (0)