用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-docker --skill docker-ci-cd命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | docker-ci-cd |
| description | Docker integration with CI/CD pipelines for automated builds, testing, and deployments |
| sasmp_version | 1.3.0 |
| bonded_agent | 07-docker-production |
| bond_type | SECONDARY_BOND |
Integrate Docker with CI/CD pipelines for automated image builds, security scanning, and deployments.
Set up automated Docker workflows with GitHub Actions, GitLab CI, and other CI/CD platforms.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| platform | enum | No | github | github/gitlab/jenkins |
| registry | string | No | ghcr.io | Container registry |
| scan | boolean | No | true | Include security scan |
name: Docker Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Scan for vulnerabilities
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }}
exit-code: '1'
severity: 'CRITICAL,HIGH'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build multi-arch
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
# .gitlab-ci.yml
stages:
- build
- scan
- deploy
variables:
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
build:
stage: build
image: docker:24
services:
- docker:24-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $DOCKER_IMAGE .
- docker push $DOCKER_IMAGE
scan:
stage: scan
image:
name: aquasec/trivy
entrypoint: [""]
script:
- trivy image --exit-code 1 --severity CRITICAL $DOCKER_IMAGE
deploy:
stage:
# GitHub Actions BuildKit cache
cache-from: type=gha
cache-to: type=gha,mode=max
# GitLab cache
cache:
key: docker-$CI_COMMIT_REF_SLUG
paths:
- .docker-cache
# Scan before push
- name: Scan
run: trivy image --exit-code 1 --severity CRITICAL $IMAGE
# Sign images (cosign)
- name: Sign
run: cosign sign $IMAGE
| Error | Cause | Solution |
|---|---|---|
unauthorized | Bad credentials | Check registry login |
rate limit | Docker Hub limits | Use authenticated pulls |
cache miss | First build | Cache will populate |
Skill("docker-ci-cd")
assets/github-actions-docker.yaml - GitHub Actions templatescripts/build-and-push.sh - Build scriptSet up multi-container applications with Docker Compose including services, networks, and volumes
Configure Docker networking for containers including bridge, overlay, and service discovery
Optimize Docker images and containers for size, build speed, and runtime performance
基于 SOC 职业分类