Skip to content
container-registry-setup logo

Container Registry Setup Expert

container-registry-setup

Эксперт по container registry. Используй для настройки ECR, Harbor, Docker Hub, image security и CI/CD интеграции.

SKILL.md

Full skill instructions

Container Registry Setup Expert

Эксперт по настройке и управлению container registries.

Типы Registry

Cloud-Managed

RegistryProviderFeatures
ECRAWSIAM integration, scanning
Artifact RegistryGCPMulti-format, regional
ACRAzureAD integration, geo-rep
Docker HubDockerPublic/​private, CI/​CD

Self-Hosted

RegistryBest ForFeatures
HarborEnterpriseRBAC, scanning, replication
NexusMulti-artifactMaven, npm, Docker
ArtifactoryEnterpriseUniversal, HA
DistributionSimpleOfficial Docker registry

AWS ECR Setup

Terraform Configuration

resource "aws_ecr_repository" "app" {
  name                 = "my-application"
  image_tag_mutability = "IMMUTABLE"

  image_scanning_configuration {
    scan_on_push = true
  }

  encryption_configuration {
    encryption_type = "KMS"
    kms_key         = aws_kms_key.ecr.arn
  }

  tags = {
    Environment = "production"
    Team        = "platform"
  }
}

resource "aws_ecr_lifecycle_policy" "cleanup" {
  repository = aws_ecr_repository.app.name

  policy = jsonencode({
    rules = [
      {
        rulePriority = 1
        description  = "Keep last 10 images"
        selection = {
          tagStatus     = "tagged"
          tagPrefixList = ["v"]
          countType     = "imageCountMoreThan"
          countNumber   = 10
        }
        action = {
          type = "expire"
        }
      },
      {
        rulePriority = 2
        description  = "Remove untagged after 7 days"
        selection = {
          tagStatus   = "untagged"
          countType   = "sinceImagePushed"
          countUnit   = "days"
          countNumber = 7
        }
        action = {
          type = "expire"
        }
      }
    ]
  })
}

ECR Authentication

# Login to ECR
aws ecr get-login-password --region us-east-1 | \
  docker login --username AWS --password-stdin \
  123456789.dkr.ecr.us-east-1.amazonaws.com

# Push image
docker tag myapp:latest 123456789.dkr.ecr.us-east-1.amazonaws.com/​myapp:latest
docker push 123456789.dkr.ecr.us-east-1.amazonaws.com/​myapp:latest

Harbor Self-Hosted

Docker Compose Setup

version: '3'
services:
  harbor-core:
    image: goharbor/​harbor-core:v2.9.0
    container_name: harbor-core
    env_file:
      - ./​common/​config/​core/​env
    volumes:
      - ./​common/​config/​core/​certificates:/​etc/​core/​certificates
      - ./​common/​config/​core/​key:/​etc/​core/​key
    depends_on:
      - registry
      - redis
      - postgresql
    networks:
      - harbor

  registry:
    image: goharbor/​registry-photon:v2.9.0
    container_name: registry
    volumes:
      - registry_data:/​storage
      - ./​common/​config/​registry:/​etc/​registry
    networks:
      - harbor

  postgresql:
    image: goharbor/​harbor-db:v2.9.0
    container_name: harbor-db
    volumes:
      - database:/​var/​lib/​postgresql/​data
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    networks:
      - harbor

  redis:
    image: goharbor/​redis-photon:v2.9.0
    container_name: harbor-redis
    volumes:
      - redis:/​var/​lib/​redis
    networks:
      - harbor

  nginx:
    image: goharbor/​nginx-photon:v2.9.0
    container_name: nginx
    ports:
      - "80:8080"
      - "443:8443"
    volumes:
      - ./​common/​config/​nginx:/​etc/​nginx
    depends_on:
      - harbor-core
    networks:
      - harbor

volumes:
  registry_data:
  database:
  redis:

networks:
  harbor:
    driver: bridge

Image Security

Vulnerability Scanning

# Trivy scan
trivy image myapp:latest

# Grype scan
grype myapp:latest

# ECR scan results
aws ecr describe-image-scan-findings \
  --repository-name myapp \
  --image-id imageTag=latest

Image Signing with Cosign

# Generate key pair
cosign generate-key-pair

# Sign image
cosign sign --key cosign.key myregistry/​myapp:latest

# Verify signature
cosign verify --key cosign.pub myregistry/​myapp:latest

Content Trust (Docker)

# Enable content trust
export DOCKER_CONTENT_TRUST=1

# Sign and push
docker push myregistry/​myapp:latest

# Verify on pull
docker pull myregistry/​myapp:latest

Kubernetes Integration

Image Pull Secret

apiVersion: v1
kind: Secret
metadata:
  name: registry-credentials
  namespace: default
type: kubernetes.io/​dockerconfigjson
data:
  .dockerconfigjson: |
    eyJhdXRocyI6eyJteXJlZ2lzdHJ5LmNvbSI6eyJ1c2VybmFtZSI6InVzZXIi
    LCJwYXNzd29yZCI6InBhc3MiLCJhdXRoIjoiZFhObGNqcHdZWE56In19fQ==

Deployment with Pull Secret

apiVersion: apps/​v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
        - name: myapp
          image: myregistry.com/​myapp:v1.0.0
          imagePullPolicy: Always
      imagePullSecrets:
        - name: registry-credentials

ServiceAccount Configuration

apiVersion: v1
kind: ServiceAccount
metadata:
  name: myapp-sa
  namespace: default
imagePullSecrets:
  - name: registry-credentials

CI/​CD Integration

GitHub Actions

name: Build and Push

on:
  push:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4

      - name: Set up Docker Buildx
        uses: docker/​setup-buildx-action@v3

      - name: Login to ECR
        uses: aws-actions/​amazon-ecr-login@v2

      - name: Login to Docker Hub
        uses: docker/​login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push
        uses: docker/​build-push-action@v5
        with:
          context: .
          platforms: linux/​amd64,linux/​arm64
          push: true
          tags: |
            123456789.dkr.ecr.us-east-1.amazonaws.com/​myapp:${{ github.sha }}
            myuser/​myapp:${{ github.sha }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

GitLab CI

stages:
  - build
  - push

variables:
  IMAGE_NAME: $CI_REGISTRY_IMAGE

build:
  stage: build
  image: docker:24
  services:
    - docker:24-dind
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
    - docker build -t $IMAGE_NAME:$CI_COMMIT_SHA .
    - docker push $IMAGE_NAME:$CI_COMMIT_SHA
  only:
    - main

Cleanup Scripts

ECR Cleanup

import boto3
from datetime import datetime, timedelta

def cleanup_untagged_images(repository: str, days_old: int = 7):
    """Remove untagged images older than specified days."""
    ecr = boto3.client('ecr')

    response = ecr.describe_images(
        repositoryName=repository,
        filter={'tagStatus': 'UNTAGGED'}
    )

    cutoff = datetime.now() - timedelta(days=days_old)

    images_to_delete = []
    for image in response['imageDetails']:
        if image['imagePushedAt'].replace(tzinfo=None) < cutoff:
            images_to_delete.append({
                'imageDigest': image['imageDigest']
            })

    if images_to_delete:
        ecr.batch_delete_image(
            repositoryName=repository,
            imageIds=images_to_delete
        )
        print(f"Deleted {len(images_to_delete)} images")

# Usage
cleanup_untagged_images('my-app', days_old=7)

Performance Optimization

Registry Caching

# Docker daemon.json
{
  "registry-mirrors": ["https://mirror.gcr.io"],
  "insecure-registries": [],
  "max-concurrent-downloads": 10,
  "max-concurrent-uploads": 5
}

Pull-Through Cache (Harbor)

# Harbor project config
replication:
  - name: docker-hub-proxy
    type: pull-through
    source: https://registry-1.docker.io
    filters:
      - name: library/​*
    trigger:
      type: manual

Troubleshooting

# Test connectivity
curl -v https://myregistry.com/​v2/

# Check authentication
docker login myregistry.com

# Verify TLS
openssl s_client -connect myregistry.com:443 -servername myregistry.com

# Clear credentials
docker logout myregistry.com
rm ~/​.docker/​config.json

# Debug pull issues
docker pull myregistry.com/​myapp:latest --debug

Лучшие практики

  1. Image immutability — используйте immutable tags
  2. Vulnerability scanning — scan on push обязателен
  3. Lifecycle policies — автоматическая очистка старых images
  4. Content trust — подписывайте production images
  5. Geo-replication — для global deployments
  6. Access control — минимальные права через RBAC
  7. Monitoring — алерты на failed pushes и pulls

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View