Docker integration with CI/CD pipelines for automated builds, testing, and deployments
Sets up automated Docker CI/CD pipelines with GitHub Actions, GitLab CI, or Jenkins for building, scanning, and deploying container images. Claude uses this when you need to create or configure workflows that build Docker images on push/PR, scan for vulnerabilities, and push to registries like GHCR or Docker Hub.
/plugin marketplace add pluginagentmarketplace/custom-plugin-docker/plugin install pluginagentmarketplace-docker-container-assistant@pluginagentmarketplace/custom-plugin-dockerThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/github-actions-docker.yamlreferences/CI-CD-GUIDE.mdscripts/build-and-push.shIntegrate 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: deploy
script:
- ssh deploy@server "docker pull $DOCKER_IMAGE && docker compose up -d"
only:
- main
# 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 scriptThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.