示例依赖 Docker 官方 Actions 与 Trivy、Super-Linter、k3d 等第三方 Action,需在仓库中启用对应权限;多平台构建依赖 QEMU 与 Buildx,需先执行 Setup QEMU 和 Setup Buildx 步骤;推送镜像需配置 Docker Hub 等 registry 的登录凭据
docker-ci-automation
BretFisherUnlicense更新放缓一套用 Docker 官方 GitHub Actions 搭建 CI/CD 流水线的示例集合,演示如何自动构建、测试和推送镜像,适合照着抄作业。
GitHub Actions automation examples with Docker's official actions
直接 fork 或克隆仓库后查看 .github/workflows 目录中的示例工作流README 未说明
用 Docker 官方 GitHub Actions 搭建 CI 流水线的分步示例仓库,从基础构建到多平台、CVE 扫描逐步加码
一套用 Docker 官方 GitHub Actions 搭建 CI/CD 流水线的示例集合,演示如何自动构建、测试和推送镜像,适合照着抄作业。
核心能力
- 按编号从基础 Docker 构建到并行化共 11 个递进示例
- 演示 Buildx 缓存与多平台构建配置
- 用 Metadata Action 为镜像生成标签与元数据
- 集成 Trivy 做 CVE 扫描与安全报告
- 加入单元、集成与 k3d Kubernetes 冒烟测试
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Automation with Docker for CI Workflows
For Docker Community All Hands 2022
Watch the walkthrough of this repo: https://www.youtube.com/watch?v=aZzV6X7XhyI
See this repositories' .github/workflows directory for the below example workflows, ordered by number, simple to complex.
These examples are focused on five of Docker's official GitHub Actions.
These examples are based on three workflow diagrams on progressively more complex automation pipelines:
- Basic code PR automation workflow
- Intermediate code PR automation workflow
- Advanced code PR automation workflow
I also have a LIVE course on learning GitHub Actions for DevOps automation and Argo CD for GitOps-style deployments.
Example Workflows
- Basic Docker build
- Adding BuildKit cache
- Adding multi-platform builds
- Adding metadata to images
- Adding comments with image tags to PRs
- Adding CVE scanning
- Adding CVE security reporting
- Adding unit testing
- Adding integration testing
- Adding Kubernetes smoke tests
- Adding job parallelizing for mucho speed
GitHub Actions shown in these examples
- Docker Login
- Docker Setup Buildx
- Docker Setup QEMU
- Docker Metadata
- Docker Build and Push
- Aqua Security Trivy CVE Scan
- Super-Linter
- Setup k3d
- Find Comment
- Create or Update Comment
This repository is part of my example DevOps repos on GitHub Actions
- bretfisher/github-actions-templates - Main reusable templates repository
- bretfisher/super-linter-workflow - Reusable linter workflow
- bretfisher/docker-build-workflow- Reusable docker build workflow
- (you are here) bretfisher/docker-ci-automation - Step by step video and example of a Docker CI workflow
- My full list of container examples and tools
More reading
Docker Build/Push Action advanced examples My full list of container examples and tools
