Get the FREE Ultimate OpenClaw Setup Guide →

ln-783-container-launcher

Scanned
npx machina-cli add skill levnikolaevich/claude-code-skills/ln-783-container-launcher --openclaw
Files (1)
SKILL.md
6.6 KB

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

ln-783-container-launcher

Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-780-bootstrap-verifier


Purpose

Builds Docker images, launches containers, and performs comprehensive health verification using Docker native health checks and retry strategies.

Scope:

  • Detect and validate docker-compose.yml configuration
  • Build Docker images
  • Launch containers with proper startup order
  • Verify container health using native health checks
  • Provide access URLs and cleanup instructions

Out of Scope:

  • Building application code (handled by ln-781)
  • Running tests (handled by ln-782)
  • Container orchestration beyond single host (Kubernetes, Swarm)

When to Use

ScenarioUse This Skill
Called by ln-780 orchestratorYes
Standalone container launchYes
Development environment setupYes
Production deploymentNo, use proper CI/CD

Workflow

Step 1: Pre-flight Checks

Verify Docker environment readiness.

CheckFailure Action
Docker daemon runningReport error with installation instructions
Docker Compose availableReport error, suggest installation
Compose file existsReport error, list expected locations
Required ports freeReport conflict, suggest alternatives
Sufficient disk spaceWarn if low space (<2GB free)

Step 2: Parse Compose Configuration

Extract service information from docker-compose.yml.

InformationPurpose
Service namesTrack which containers to monitor
Exposed portsKnow which ports to check
Health check definitionsUse native health checks if defined
Dependencies (depends_on)Understand startup order
Volume mountsVerify paths exist

Step 3: Build Images

Build all images defined in compose file.

AspectStrategy
Build contextUse paths from compose file
Build argsPass through from compose configuration
CacheUse Docker layer cache for speed
FailureReport build errors with full log

Step 4: Launch Containers

Start containers with proper orchestration.

AspectStrategy
Startup orderRespect depends_on and healthcheck conditions
Detached modeRun in background
NetworkUse compose-defined networks
VolumesMount all defined volumes

Step 5: Health Verification

Verify all containers are healthy using appropriate strategy.

Strategy Selection:

ConditionStrategy
Service has healthcheck: in composeUse native Docker health status
Service has depends_on: condition: service_healthyWait for Docker health status
No healthcheck definedUse external HTTP probe with retry

Retry Configuration:

ParameterValueRationale
Max attempts10Allow slow-starting services
Initial delay5sGive containers time to start
BackoffExponential (5, 10, 20, 40s)Avoid overwhelming services
Max total wait120sReasonable upper limit

Health Check Methods:

MethodWhen to Use
Docker health statusWhen container has healthcheck defined
HTTP GET to exposed portFor web services without healthcheck
Container execFor services without exposed ports
TCP port checkFor databases and message queues

Step 6: Report Results

Return structured results to orchestrator.

Result Structure:

FieldDescription
containersArray of container status objects
healthChecksArray of health check results
accessUrlsMap of service name to access URL
overallStatushealthy / unhealthy / partial
startupDurationTime from launch to all healthy

Container Status Object:

FieldDescription
nameContainer name
serviceService name from compose
statusrunning / exited / restarting
healthhealthy / unhealthy / starting / none
portExposed port (if any)
startedAtContainer start timestamp

Health Check Result:

FieldDescription
urlChecked URL or endpoint
statusHTTP status code or check result
responseTimeTime to respond in ms
healthyBoolean health status

Error Handling

Error TypeAction
Docker daemon not runningReport with start instructions
Port already in useReport conflict, suggest docker compose down first
Image build failedReport with build logs
Container exitedReport with container logs
Health check timeoutReport with last known status and logs
Network unreachableCheck Docker network configuration

Options

OptionDefaultDescription
keepRunningtrueLeave containers running after verification
stopAfterfalseStop containers after successful verification
healthTimeout120Max seconds to wait for healthy status
showLogstrueShow container logs on failure
buildFirsttrueBuild images before starting
pullLatestfalsePull base images before build

Cleanup Instructions

Provide user with cleanup commands in report.

ActionDescription
Stop containersStop running containers, preserve data
Remove containers and networksClean up containers but keep volumes
Remove everythingFull cleanup including volumes and images

Critical Rules

  1. Use native health checks when available - more reliable than external probes
  2. Implement retry with backoff - services need time to initialize
  3. Always collect logs on failure - essential for debugging
  4. Parse compose file for ports - do not hardcode port numbers
  5. Respect depends_on order - critical for database-dependent services

Definition of Done

  • Docker environment verified
  • All images built successfully
  • All containers running
  • All health checks passing
  • Access URLs provided
  • Results returned to orchestrator

Reference Files

  • Parent: ../ln-780-bootstrap-verifier/SKILL.md

Version: 2.0.0 Last Updated: 2026-01-10

Source

git clone https://github.com/levnikolaevich/claude-code-skills/blob/master/ln-783-container-launcher/SKILL.mdView on GitHub

Overview

This skill builds Docker images from a docker-compose.yml, launches containers in the correct startup order, and performs comprehensive health verification using Docker native health checks and retry strategies. It validates the compose configuration, exposes access URLs, and provides cleanup instructions, making deployments reliable on a single host.

How This Skill Works

It first performs pre-flight checks on Docker, Compose, the compose file location, ports, and disk space. It then parses the docker-compose.yml to learn service names, ports, healthcheck definitions, dependencies, and volumes, builds images, and launches containers in the correct order. Finally, it verifies health using Docker health status when healthchecks exist, waits for depends_on conditions, or falls back to external HTTP/tcp/exec probes with a defined retry schedule, and reports results back to the orchestrator.

When to Use It

  • Called by ln-780 orchestrator
  • Standalone container launch
  • Development environment setup
  • Production deployment (not recommended; use CI/CD)
  • Local testing of docker-compose configurations

Quick Start

  1. Step 1: Ensure Docker and Docker Compose are installed and your docker-compose.yml is ready
  2. Step 2: Run the launcher against your compose file to build, launch, and verify health
  3. Step 3: Review the resulting container statuses and access URLs, then clean up if needed

Best Practices

  • Validate the docker-compose.yml and its healthcheck blocks before running
  • Honor depends_on startup ordering and health status for reliable orchestration
  • Prefer Docker health checks in services to enable native health status checks
  • Use proper network isolation and mount only required volumes
  • Capture detailed build and run logs for easier troubleshooting

Example Use Cases

  • Automated CI job spins up test services with health probes and reports status
  • Local development environment where containers are launched with automatic health checks
  • Single-host microservice stack deployment with validated startup order
  • Debug session where health checks fail and logs guide retries
  • Post-job cleanup cleans up containers and networks after tests

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers