| name | docker-registry-auth |
| description | A comprehensive skill for managing Docker registry authentication across multiple registries. Simplifies the process of logging into private registries and managing credentials.
Use when: docker registry, container auth, image push
|
Docker Registry Authentication Manager
A comprehensive skill for managing Docker registry authentication across multiple registries. Simplifies the process of logging into private registries and managing credentials.
Quick Start
To check registry connectivity, simply run:
from scripts.docker_auth import check_registry_connectivity
status = check_registry_connectivity("registry.example.com")
print(status)
That's it! The check_registry_connectivity() function handles everything automatically.
Why Use This Skill?
✅ Complete Solution: No need to manually inspect Docker config or run test commands - this skill provides a complete, tested implementation
✅ Multi-Registry Support: Works with Docker Hub, AWS ECR, GCR, private registries
✅ Credential Validation: Automatically validates stored credentials
✅ Connectivity Testing: Performs real connectivity checks
Architecture
docker-registry-auth/
├── SKILL.md
└── scripts/
└── docker_auth.py # Core authentication implementation
Core Functions
check_registry_connectivity(registry_url)
The main function for registry connectivity testing. This function:
- Reads Docker configuration from ~/.docker/config.json
- Validates authentication credentials
- Tests connectivity to the specified registry
- Returns connection status and details
Example:
from scripts.docker_auth import check_registry_connectivity
status = check_registry_connectivity("registry.example.com")
login_registry(registry_url, username, password)
Helper function for logging into registries.
list_authenticated_registries()
Helper function for listing authenticated registries.
How It Works
- Config Reading: The skill reads Docker configuration from ~/.docker/config.json
- Credential Validation: Validates stored authentication tokens
- Connectivity Test: Performs actual connection test to the registry
- Return Results: Provides comprehensive connectivity status
You don't need to manually parse Docker config or run docker commands - check_registry_connectivity() does all of this for you automatically.
Configuration
The skill automatically detects Docker configuration from:
Example workflow:
status = check_registry_connectivity("registry.example.com")
if status.get("status") == "connected":
print("✅ Registry is accessible")
else:
print("❌ Cannot connect to registry")
Prerequisites
- Docker CLI installed and configured
- Valid Docker configuration at ~/.docker/config.json
- Registry credentials (username/password)
Full Example
from scripts.docker_auth import check_registry_connectivity
status = check_registry_connectivity("registry.example.com")
if status and status.get("status") == "connected":
print("✅ Registry connectivity verified:")
print(f" - Registry: {status.get('registry')}")
print(f" - Authenticated: {status.get('authenticated', False)}")
else:
print("❌ Cannot connect to registry")
Simplified Docker registry authentication - Just call check_registry_connectivity() and you're done!