waitup
A lightweight CLI tool for waiting until TCP ports and HTTP endpoints become available. Perfect for Docker containers, Kubernetes, and CI/CD pipelines.
Quick Start
# Install from source
# Wait for a TCP port
# Wait for HTTP endpoint
# Run command after service is ready
Installation
From Crates.io (Recommended)
From Source
Docker
# Pull from GitHub Container Registry
# Or build locally
# Standard image (92MB)
# Alpine image (3MB)
Pre-built Binaries
Download from releases.
Usage
Basic Examples
# Wait for TCP port with timeout
# Wait for multiple services
# Wait for any service to be ready
# HTTP health check with custom headers
Docker Compose
services:
app:
image: myapp
depends_on:
- db
entrypoint:
command:
- |
waitup db:5432 --timeout 60s -- npm start
db:
image: postgres:15
# Or use as separate service
wait-for-db:
image: ghcr.io/grok-rs/waitup:alpine
command:
depends_on:
- db
Kubernetes Init Container
initContainers:
- name: wait-for-db
image: ghcr.io/grok-rs/waitup:alpine
command:
Command Line Options
waitup [OPTIONS] <TARGETS>... [-- <COMMAND>...]
Options:
--timeout <DURATION> Total timeout (default: 30s)
--interval <DURATION> Initial retry interval (default: 1s)
--max-interval <DURATION> Maximum retry interval (default: 30s)
--connection-timeout <DURATION> Per-attempt timeout (default: 10s)
--expect-status <CODE> Expected HTTP status (default: 200)
--header <KEY:VALUE> Custom HTTP headers
--any Wait for any target (default: all)
--verbose Show detailed progress
--quiet No output except errors
--json JSON output format
-h, --help Print help
-V, --version Print version
Time Format
Use human-readable duration formats:
30s- 30 seconds2m- 2 minutes1h30m- 1 hour 30 minutes500ms- 500 milliseconds
Exit Codes
0- Success, all targets are reachable1- Timeout, failed to connect within timeout2- Invalid arguments or configuration3- Command execution failed (when using--)
Environment Variables
Set defaults to avoid repetitive flags:
Features
- TCP port checking with DNS resolution
- HTTP/HTTPS health checks with custom headers
- Wait for multiple services (all or any)
- Execute commands after services are ready
- Exponential backoff with configurable intervals
- JSON output for automation
- Shell completions (bash, zsh, fish, powershell)
- Docker and Kubernetes ready
Shell Completions
# Bash
# Zsh
# Fish
Examples
Database Startup
# Wait for PostgreSQL before migrations
# Wait for multiple databases
Microservices
# Wait for dependencies with health checks
CI/CD Pipelines
# Wait for test services
Development
# Build
# Run tests
# Install locally
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE file for details.
Related Projects
Similar tools for service orchestration:
- wait-for-it - Bash script for TCP waiting
- dockerize - Go-based utility with templating
- wait-on - Node.js based waiting tool
Security
Report vulnerabilities at SECURITY.md.