docker-remote
by @elric2011
Remotely manage Docker Compose instances via SSH. Execute docker compose commands, view logs, update images, and exec into containers on remote servers. Use...
clawhub install docker-remoteπ About This Skill
name: docker-remote description: Remotely manage Docker Compose instances via SSH. Execute docker compose commands, view logs, update images, and exec into containers on remote servers. Use when deploying, monitoring, or debugging containerized applications. license: MIT compatibility: Requires SSH access and Docker Compose installed on the remote server. metadata: {"clawdbot":{"emoji":"π¬"}}
Docker Remote Skill
Remotely manage Docker Compose instances through SSH connections.
Overview
This skill provides a complete set of actions for Docker Compose lifecycle management on remote servers. All operations are performed via SSH, requiring only standard SSH and Docker tools on both client and server.
Quick Start
# Start services
docker_compose_up host=192.168.1.100 user=root path=/opt/myappCheck status
docker_compose_ps host=192.168.1.100 user=root path=/opt/myappView logs
docker_compose_logs host=192.168.1.100 user=root path=/opt/myapp tail=50Update and restart
docker_compose_update host=192.168.1.100 user=root path=/opt/myapp pull=always
Actions
docker_compose_up
Start Docker Compose services in detached mode.
Parameters:
host (required): Remote SSH host (IP or hostname)user (required): SSH usernamepath (required): Directory containing docker-compose.ymlport (optional, default: 22): SSH portkey_path (optional): SSH private key pathtimeout (optional, default: 60): Operation timeout in secondsExample:
docker_compose_up host=192.168.1.100 user=admin path=/opt/app port=2222
docker_compose_down
Stop and remove containers, networks, and volumes defined in docker-compose.yml.
Parameters: Same as up
Example:
docker_compose_down host=192.168.1.100 user=admin path=/opt/app
docker_compose_start
Start specific stopped services.
Parameters:
up parametersservice (optional): Service name to start (starts all if not specified)Example:
docker_compose_start host=192.168.1.100 user=admin path=/opt/app service=web
docker_compose_stop
Stop running services without removing them.
Parameters:
up parametersservice (optional): Service name to stop (stops all if not specified)Example:
docker_compose_stop host=192.168.1.100 user=admin path=/opt/app service=worker
docker_compose_restart
Restart services.
Parameters:
up parametersservice (optional): Service name to restartExample:
docker_compose_restart host=192.168.1.100 user=admin path=/opt/app service=api
docker_compose_ps
List all containers with their status.
Parameters: Same as up
Example:
docker_compose_ps host=192.168.1.100 user=admin path=/opt/app
docker_compose_logs
Fetch and display logs from services.
Parameters:
up parametersservice (optional): Filter logs to specific servicetail (optional, default: 100): Number of lines to showfollow (optional, default: false): Stream logs continuouslyExample:
docker_compose_logs host=192.168.1.100 user=admin path=/opt/app tail=50 follow=true
docker_compose_update
Pull the latest images and restart services.
Parameters:
up parametersforce_recreate (optional, default: false): Force recreate containerspull (optional): Image pull policy (never, always, missing)command (optional): Custom command to execute instead of default "pull && up"Example:
# Default behavior
docker_compose_update host=192.168.1.100 user=admin path=/opt/app pull=alwaysCustom command
docker_compose_update host=192.168.1.100 user=admin path=/opt/app command="sh ./upgrade.sh"
docker_compose_exec
Execute a command in a running container.
Parameters:
up parametersservice (required): Container name to execute incommand (required): Command to executetimeout (optional, default: 60): Command execution timeoutExample:
docker_compose_exec host=192.168.1.100 user=admin path=/opt/app service=web command="ls -la /app"
Implementation Notes
-d flag for detached mode when starting servicesError Handling
Common errors and handling:
1. SSH connection refused: Verify host, port, and network access 2. Authentication failed: Check SSH key path and permissions 3. Path not found: Ensure docker-compose.yml exists at specified path 4. Docker not running: Verify Docker daemon is accessible on remote host 5. Permission denied: Check user has access to Docker socket
Deployment Configuration
This skill supports a deploy-apps.json configuration file that maps your remote hosts and applications. The Agent automatically reads this configuration to resolve host aliases, app names, SSH credentials, and file paths.
Configuration File
The structure of the deploy-apps.json file should be as follows:
{
"hosts": {
"": {
"host": "remote.server.com",
"description": "Server description",
"base-dir": "/path/to/docker",
"user": "ssh-user",
"apps": {
"": {
"description": "Application description",
"update-command": "Custom command to execute update"
}
}
}
}
}
How It Works
When you reference a host alias or app name, the Agent:
1. Reads deploy-apps.json to find the matching configuration
2. Resolves host to the actual SSH hostname/IP
3. Constructs path from
4. Uses the configured user for SSH authentication
Configuration Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| hosts. | string | Yes | Remote SSH hostname or IP |
| hosts. | string | Yes | Base directory containing app folders |
| hosts. | string | Yes | SSH username |
| hosts. | string | No | Human-readable description |
| hosts. | string | Yes* | App description |
| hosts. | string | Yes* | Custom command to execute update |
Path Resolution Example
With:
base-dir: /data/dockerapp-name: mysqlThe resolved path would be: /data/docker/mysql
See Also
π‘ Examples
# Start services
docker_compose_up host=192.168.1.100 user=root path=/opt/myappCheck status
docker_compose_ps host=192.168.1.100 user=root path=/opt/myappView logs
docker_compose_logs host=192.168.1.100 user=root path=/opt/myapp tail=50Update and restart
docker_compose_update host=192.168.1.100 user=root path=/opt/myapp pull=always