Commit fcbf15e
committed
Wait for depends_on conditions before starting containers
This commit implements the long-syntax / conditional depends_on compose
mechanism which instructs the compose system to wait for a certain
condition before starting a container.
Currently available conditions are:
- service_started: same behavior as before this commit, the depending
container will start as soon as the depended on container has started
- service_healthy: if the depended on container has a healthcheck, wait
until said container is marked as healthy before starting the
depending container
- service_completed_successfully: wait until the depended on container
has exited and its exit code is 0, after which the depending container
can be started
This mechanism is part of the v3 [1] compose spec and is useful for
controlling container startup based on other containers that can take a
certain amount of time to start or on containers that do complicated
setups and must exit before starting other containers.
[1] https://red.ht/conditional-depends
Signed-off-by: Adrian Torres <atorresj@redhat.com>1 parent 30e5223 commit fcbf15e
2 files changed
+95
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
1087 | 1095 | | |
1088 | 1096 | | |
1089 | 1097 | | |
1090 | | - | |
| 1098 | + | |
1091 | 1099 | | |
1092 | 1100 | | |
1093 | 1101 | | |
| |||
1113 | 1121 | | |
1114 | 1122 | | |
1115 | 1123 | | |
1116 | | - | |
| 1124 | + | |
1117 | 1125 | | |
1118 | 1126 | | |
1119 | 1127 | | |
| |||
1970 | 1978 | | |
1971 | 1979 | | |
1972 | 1980 | | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
1973 | 2024 | | |
1974 | 2025 | | |
1975 | 2026 | | |
| |||
2012 | 2063 | | |
2013 | 2064 | | |
2014 | 2065 | | |
| 2066 | + | |
| 2067 | + | |
2015 | 2068 | | |
2016 | 2069 | | |
2017 | 2070 | | |
| |||
2047 | 2100 | | |
2048 | 2101 | | |
2049 | 2102 | | |
| 2103 | + | |
2050 | 2104 | | |
2051 | 2105 | | |
2052 | 2106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
16 | 29 | | |
17 | 30 | | |
18 | 31 | | |
| |||
21 | 34 | | |
22 | 35 | | |
23 | 36 | | |
24 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
25 | 44 | | |
26 | 45 | | |
27 | 46 | | |
| |||
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
39 | 62 | | |
40 | 63 | | |
41 | 64 | | |
| |||
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments