Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4242

container-registries

Skill này làm gì

Công cụ này giúp quản lý nơi lưu trữ và phân phối các image phần mềm (như công thức để xây dựng chương trình). Nó làm việc với các dịch vụ đám mây phổ biến như Amazon ECR, Azure ACR, Google GCR và cả Docker Hub.

Khi nào nên dùng

  • ✓Khi bạn cần đẩy hoặc kéo image phần mềm.
  • ✓Để cấu hình ai có thể truy cập kho image của bạn.
  • ✓Để thiết lập quy tắc dọn dẹp tự động các image cũ.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/container-registries/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/container-registries/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để thiết lập Docker Hub tự động đẩy image khi tôi cập nhật code trên GitHub?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng các lệnh cụ thể cho từng dịch vụ registry (ECR, ACR, GCR, Docker Hub). Bạn chỉ định dịch vụ và hành động muốn làm (đăng nhập, đẩy, kéo, cấu hình chính sách), và công cụ thực thi các lệnh cần thiết.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Container Registries

Store, manage, and distribute container images across cloud and self-hosted registries.

When to Use This Skill

Use this skill when:

  • Pushing and pulling container images
  • Configuring registry authentication
  • Setting up image retention policies
  • Managing private container registries
  • Implementing image scanning and security

Prerequisites

  • Docker or Podman installed
  • Cloud CLI tools (AWS CLI, az, gcloud) for respective registries
  • Appropriate IAM permissions

Docker Hub

Authentication

# Login
docker login

# Login with token
echo "$DOCKER_TOKEN" | docker login -u username --password-stdin

Push/Pull Images

# Tag image
docker tag myapp:latest username/myapp:latest

# Push
docker push username/myapp:latest

# Pull
docker pull username/myapp:latest

Automated Builds

Configure in Docker Hub UI:

  1. Connect GitHub/Bitbucket repository
  2. Set build rules (branch → tag mapping)
  3. Configure build context and Dockerfile path

Amazon ECR

Setup

# 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)

Authentication

# 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"
  }
}

Push/Pull

# Tag and push
docker tag myapp:latest $REGISTRY/myapp:latest
docker push $REGISTRY/myapp:latest

# Pull
docker pull $REGISTRY/myapp:latest

Lifecycle Policy

# 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"
        }
      }
    ]
  }'

Repository Policy

# 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"
        ]
      }
    ]
  }'

Azure Container Registry (ACR)

Setup

# 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

Authentication

# 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

Push/Pull

# 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 .

Retention Policy

# Enable retention policy
az acr config retention update \
  --registry myregistry \
  --status enabled \
  --days 30 \
  --type UntaggedManifests

Geo-Replication

# Enable replication
az acr replication create \
  --registry myregistry \
  --location westeurope

# List replications
az acr replication list --registry myregistry

Google Container Registry (GCR) / Artifact Registry

Setup (Artifact Registry)

# Create repository
gcloud artifacts repositories create myrepo \
  --repository-format=docker \
  --location=us-central1 \
  --description="Docker repository"

Authentication

# 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

…

Câu hỏi thường gặp

“Container images” là gì?

Đó là các gói chứa mọi thứ chương trình cần để chạy: code, thư viện và cấu hình. Hãy xem chúng như “công thức” có sẵn để xây dựng và chạy phần mềm một cách nhất quán.

Tôi có cần biết lập trình để dùng không?

Bạn không cần là lập trình viên giàu kinh nghiệm. Công cụ đơn giản hóa các tác vụ thường gặp, nhưng bạn vẫn cần làm theo hướng dẫn và dùng các lệnh được cung cấp.

Tôi có thể dùng cho mọi loại file không?

Không, công cụ này dành riêng cho việc quản lý “container images”, chủ yếu dùng để đóng gói và phân phối ứng dụng phần mềm.

Chi tiết

Mô tả gốc của tác giả

Manage container registries including ECR, ACR, GCR, and Docker Hub.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4242
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự