Categorygithub.com/nncdevel-io/wait-dockerd-startup
modulepackage
1.2.0
Repository: https://github.com/nncdevel-io/wait-dockerd-startup.git
Documentation: pkg.go.dev

# README

wait-dockerd-startup

Wait until docker API(docker daemon) startup.

Install

go get github.com/nncdevel-io/wait-dockerd-startup

Usage

$ wait-dockerd-startup --help
Wait until docker daemon startup.

Usage:
  wait-dockerd [flags]

Flags:
  -f, --failure-threshold int    Threshold value for detect Failure. (default 10)
  -h, --help                     help for wait-dockerd
  -i, --initial-delay duration   Initial delay (default 10s)
  -p, --period duration          Check period. (default 10s)
  -s, --success-threshold int    Threshold value for detect Succeed. (default 1)
  -t, --timeout duration         Docker API request timeout. (default 1s)

How It Works

  1. Sleep --interval setting duration.
  2. Send request to docker SystemInfo API and parse server version information.
  3. If got server version info, increment success count. On the other hand, increment failure count.
  4. If success/failure count greater than or equal to threshold options, the program will exit 0 or 1.

# Packages

go:generate mockgen -source=$GOFILE -package=mock_$GOPACKAGE -destination=../mock/$GOPACKAGE/$GOFILE.
No description provided by the author
No description provided by the author