Manage container registries including ECR, ACR, GCR, and Docker Hub. Push and pull images, configure authentication, set up repository policies, and implement image lifecycle management. Use when working with container image storage and distribution.
npx skills add https://github.com/BagelHole/DevOps-Security-Agent-Skills --skill container-registries
Store, manage, and distribute container images across cloud and self-hosted registries.
Use this skill when:
# Login
docker login
# Login with token
echo "$DOCKER_TOKEN" | docker login -u username --password-stdin
# Tag image
docker tag myapp:latest username/myapp:latest
# Push
docker push username/myapp:latest
# Pull
docker pull username/myapp:latest
Configure in Docker Hub UI:
# Create repository
aws ecr create-repository \
--repository-name myapp \
--image-scanning-configuration scanOnPush=true \
--encryption-configuration encryptionType=AES256
# Get registry URI
REGISTRY=$(aws ecr describe-repositories \
--repository-names myapp \
--query 'repositories[0].repositoryUri' \
--output text | cut -d'/' -f1)
# Login (Docker)
aws ecr get-login-password --region us-east-1 | \
docker login --username AWS --password-stdin $REGISTRY
# Login with credential helper
# Add to ~/.docker/config.json:
{
"credHelpers": {
"123456789.dkr.ecr.us-east-1.amazonaws.com": "ecr-login"
}
}
# Tag and push
docker tag myapp:latest $REGISTRY/myapp:latest
docker push $REGISTRY/myapp:latest
# Pull
docker pull $REGISTRY/myapp:latest
# Create lifecycle policy
aws ecr put-lifecycle-policy \
--repository-name myapp \
--lifecycle-policy-text '{
"rules": [
{
"rulePriority": 1,
"description": "Keep last 10 images",
"selection": {
"tagStatus": "any",
"countType": "imageCountMoreThan",
"countNumber": 10
},
"action": {
"type": "expire"
}
}
]
}'
# Allow cross-account access
aws ecr set-repository-policy \
--repository-name myapp \
--policy-text '{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CrossAccountPull",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::OTHER_ACCOUNT:root"
},
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage"
]
}
]
}'
# Create registry
az acr create \
--resource-group mygroup \
--name myregistry \
--sku Standard \
--admin-enabled false
# Get login server
az acr show --name myregistry --query loginServer -o tsv
# Login with Azure CLI
az acr login --name myregistry
# Login with service principal
docker login myregistry.azurecr.io \
-u $SP_APP_ID \
-p $SP_PASSWORD
# Get access token
az acr login --name myregistry --expose-token
# Tag and push
docker tag myapp:latest myregistry.azurecr.io/myapp:latest
docker push myregistry.azurecr.io/myapp:latest
# ACR Build (build in cloud)
az acr build \
--registry myregistry \
--image myapp:latest \
--file Dockerfile .
# Enable retention policy
az acr config retention update \
--registry myregistry \
--status enabled \
--days 30 \
--type UntaggedManifests
# Enable replication
az acr replication create \
--registry myregistry \
--location westeurope
# List replications
az acr replication list --registry myregistry
# Create repository
gcloud artifacts repositories create myrepo \
--repository-format=docker \
--location=us-central1 \
--description="Docker repository"
# Configure Docker auth
gcloud auth configure-docker us-central1-docker.pkg.dev
# Or use credential helper
gcloud auth print-access-token | \
docker login -u oauth2accesstoken --password-stdin \
https://us-central1-docker.pkg.dev
# Tag for Artifact Registry
docker tag myapp:latest \
us-central1-docker.pkg.dev/PROJECT_ID/myrepo/myapp:latest
# Push
docker push us-central1-docker.pkg.dev/PROJECT_ID/myrepo/myapp:latest
# Pull
docker pull us-central1-docker.pkg.dev/PROJECT_ID/myrepo/myapp:latest
# Create cleanup policy
gcloud artifacts repositories set-cleanup-policies myrepo \
--location=us-central1 \
--policy=policy.json
# policy.json
{
"name": "delete-old",
"action": {"type": "Delete"},
"condition": {
"olderThan": "30d",
"tagState": "untagged"
}
}
# Login with PAT
echo "$GITHUB_TOKEN" | docker login ghcr.io -u USERNAME --password-stdin
# Tag
docker tag myapp:latest ghcr.io/OWNER/myapp:latest
# Push
docker push ghcr.io/OWNER/myapp:latest
# Pull
docker pull ghcr.io/OWNER/myapp:latest
Configure in GitHub:
# Run registry
docker run -d -p 5000:5000 \
--name registry \
-v registry-data:/var/lib/registry \
registry:2
# Configure TLS
docker run -d -p 443:5000 \
--name registry \
-v /certs:/certs \
-v registry-data:/var/lib/registry \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
registry:2
# Download Harbor
wget https://github.com/goharbor/harbor/releases/download/v2.9.0/harbor-online-installer-v2.9.0.tgz
tar xzvf harbor-online-installer-v2.9.0.tgz
# Configure harbor.yml
# Set hostname, https certificate, admin password
# Install
./install.sh --with-trivy --with-chartmuseum
# ECR - Enable scan on push
aws ecr put-image-scanning-configuration \
--repository-name myapp \
--image-scanning-configuration scanOnPush=true
# Get scan results
aws ecr describe-image-scan-findings \
--repository-name myapp \
--image-id imageTag=latest
# ACR - Scan with Defender
az acr task create \
--registry myregistry \
--name scan-images \
--cmd "mcr.microsoft.com/azure-cli az acr run-scan"
# Enable content trust
export DOCKER_CONTENT_TRUST=1
# Sign image on push
docker push myregistry/myapp:latest
# Verify signature
docker trust inspect myregistry/myapp:latest
Problem: Push/pull fails with auth error
Solution: Re-run login command, check credential helper
Problem: Pull fails with manifest unknown
Solution: Verify tag exists, check registry URL
Problem: Cannot push to repository
Solution: Check IAM permissions, verify repository exists
Problem: Too many requests error
Solution: Authenticate for higher limits, use pull-through cache
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges
Coordinate multi-layer security scanning and hardening across application, infrastructure, and compliance controls.
Implement Kubernetes security policies including NetworkPolicy, PodSecurityPolicy, and RBAC for production-grade security. Use when securing Kubernetes clusters, implementing network isolation, or enforcing pod security standards.
Implement Kubernetes security policies including NetworkPolicy, PodSecurityPolicy, and RBAC for production-grade security. Use when securing Kubernetes clusters, implementing network isolation, or enforcing pod security standards.
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
Comprehensive AWS security posture assessment using AWS CLI and security best practices
Take bagelhole/container-registries from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference docker.
Without those the skill loads but fails at the first command.