Skip to content

How to fix Docker health check timeout (container state: unhealthy) #1020

Answered by strarsis
strarsis asked this question in Q&A
Discussion options

You must be logged in to vote

So the health check command Docker uses is defined here:
https://github.com/smallstep/certificates/blob/master/docker/Dockerfile.step-ca#L25
(step ca health 2>/dev/null | grep "^ok" >/dev/null)

When I use docker compose exec to invoke that command on the running container the command demands additional CLI arguments.
The ca health command doesn't attach to a running step CA daemon, instead it does a standalone check (whether it can connect to it).

docker compose exec step-ca step ca health
'step ca health' requires the '--ca-url' flag
With the --ca-url flag is passed (--ca-url=https://ca.localhost):
'step ca health' requires the '--root' flag
With the -root flag also passed (--root):
flag…

Replies: 24 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rhoot
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tashian
Comment options

tashian Aug 22, 2022
Collaborator

Answer selected by strarsis
Comment options

You must be logged in to vote
1 reply
@strarsis
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
7 participants
Converted from issue

This discussion was converted from issue #463 on August 17, 2022 22:12.