docker run --health-cmd 'curl -f http://localhost/' --health-interval 30s myapp
Run with a custom health check
Docker probes the container every 30 seconds with the given command, marking it healthy or unhealthy. Health status shows in docker ps and drives swarm restarts. Define checks in the Dockerfile with HEALTHCHECK instead.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.