GitXplorerGitXplorer
s

docker-healthcheck-action

public
5 stars
2 forks
1 issues

Commits

List of commits on branch main.
Verified
16772b4e2508a00c36d58f0237d68a7399fead97

Switch to node20 runner (#4)

sstringbean committed a year ago
Verified
3333ffbde6a20447793722a29c1d0237ef2700bc

Update dependencies & switch to Node 16 (#3)

sstringbean committed 2 years ago
Verified
5cd950cd372298951dd153e980462980d4816821

Correct license

sstringbean committed 3 years ago
Verified
61cfb7f054993db183c06e51050d6bedfc092a20

Include version in README

sstringbean committed 3 years ago
Verified
3867b1de31cafbebed6e0ed06146ede5337bcc7a

Release 1.0.0

sstringbean committed 3 years ago
Verified
688eda5a8ad7e07e6e855f7fe690542e5d1cce05

Add documentation

sstringbean committed 3 years ago

README

The README file for this repository.

Docker Container Health Check

GitHub Action for checking the status of a Docker container.

Usage

Get the status of a container

To query the status of a container, pass the container name (or id) to the action:

jobs:
  test:
    steps:
      - name: Get container status
        uses: stringbean/docker-healthcheck-action@v1
        id: missing-container
        with:
          container: unknown
      - run: echo "Container is ${{ steps.missing-container.outputs.status  }}"

This will output "Container is not-running".

Waiting for a container to become healthy

To wait for a container to become healthy, pass in the required status & require-healthy: true:

jobs:
  test:
    steps:
      - name: Start container
        run: docker run -d --rm --name hello-world crccheck/hello-world
      - name: Wait for container
        uses: stringbean/docker-healthcheck-action@v1
        with:
          container: hello-world
          wait-time: 50
          require-status: running
          require-healthy: true

This will start the hello-world container and wait for it to pass a health check. If the container takes longer than 60 seconds to become healthy it will fail the build.

Configuration

Inputs

Name Description Default
container Name of the container to check none (required)
require-status Container status to expect/wait for. none
require-healthy Require (or wait for) the container to be healthy. false
wait-time Maximum number of time to wait for the container to reach the required state/health. 0 (seconds)

Outputs

Name Description Examples
status Current status of the container. not-found, running
healthy Whether the container is healthy. true, false