Skip to content

Commit 547cc57

Browse files
committed
Merge branch 'docs-healthcheck'
Manually merging #2595 to include a tiny fix.
2 parents 7342102 + 003a165 commit 547cc57

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docker/models/containers.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,28 @@ def run(self, image, command=None, stdout=True, stderr=False,
605605
group_add (:py:class:`list`): List of additional group names and/or
606606
IDs that the container process will run as.
607607
healthcheck (dict): Specify a test to perform to check that the
608-
container is healthy.
608+
container is healthy. The dict takes the following keys:
609+
610+
- test (:py:class:`list` or str): Test to perform to determine
611+
container health. Possible values:
612+
613+
- Empty list: Inherit healthcheck from parent image
614+
- ``["NONE"]``: Disable healthcheck
615+
- ``["CMD", args...]``: exec arguments directly.
616+
- ``["CMD-SHELL", command]``: Run command in the system's
617+
default shell.
618+
619+
If a string is provided, it will be used as a ``CMD-SHELL``
620+
command.
621+
- interval (int): The time to wait between checks in
622+
nanoseconds. It should be 0 or at least 1000000 (1 ms).
623+
- timeout (int): The time to wait before considering the check
624+
to have hung. It should be 0 or at least 1000000 (1 ms).
625+
- retries (int): The number of consecutive failures needed to
626+
consider a container as unhealthy.
627+
- start_period (int): Start period for the container to
628+
initialize before starting health-retries countdown in
629+
nanoseconds. It should be 0 or at least 1000000 (1 ms).
609630
hostname (str): Optional hostname for the container.
610631
init (bool): Run an init inside the container that forwards
611632
signals and reaps processes

0 commit comments

Comments
 (0)