Skip to content

Commit c1774b2

Browse files
authored
added retries docker running (#731)
1 parent df82747 commit c1774b2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

app/docker.sls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ docker_app_container_{{ loop.index }}:
8080
- networks: {{ app["networks"] | replace("__APP_NAME__", app_name) }}
8181
{%- endif %}
8282
- privileged: {{ app["privileged"] | default(False) }}
83+
{%- if app["retries_docker_running"] is defined %}
84+
- retry:
85+
attempts: {{ app["retries_docker_running"] }}
86+
interval: {{ app.get("retries_interval_docker_running", 5) }}
87+
until: True
88+
{%- endif %}
8389
{%- if "command" in app %}
8490
- command : {{ app["command"] }}
8591
{%- endif %}

app/pillar.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ app:
301301
... # see above
302302
binds: # optional, see https://docs.saltproject.io/en/latest/ref/states/all/salt.states.docker_container.html#salt.states.docker_container.running, salt has different meaning for binds
303303
- /var/www/proto/app/data:/app/data:rw
304+
#retries_docker_running: 3 # optional, retries for docker_container.running only
305+
#retries_interval_docker_running: 5 # optional, seconds between retries, works only if retries_docker_running count is defined
304306
#volumes: # optional
305307
# - ...
306308
#volumes_from: ... # optional

0 commit comments

Comments
 (0)