Skip to content

Commit ae4fdea

Browse files
committed
Update workflow to push to Docker Hub instead of GitHub Container Registry
1 parent 697f45e commit ae4fdea

File tree

3 files changed

+149
-16
lines changed

3 files changed

+149
-16
lines changed

.github/workflows/docker-build.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Build and Push
1+
name: Docker Build and Push to Docker Hub
22

33
on:
44
push:
@@ -10,36 +10,34 @@ on:
1010
workflow_dispatch:
1111

1212
env:
13-
REGISTRY: ghcr.io
14-
IMAGE_NAME: ${{ github.repository }}
13+
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/ai-coder-allinone
1514

1615
jobs:
1716
build-and-push:
1817
runs-on: ubuntu-latest
19-
permissions:
20-
contents: read
21-
packages: write
2218

2319
steps:
2420
- name: Checkout repository
2521
uses: actions/checkout@v4
2622

23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
2726
- name: Set up Docker Buildx
2827
uses: docker/setup-buildx-action@v3
2928

30-
- name: Log in to Container Registry
29+
- name: Log in to Docker Hub
3130
if: github.event_name != 'pull_request'
3231
uses: docker/login-action@v3
3332
with:
34-
registry: ${{ env.REGISTRY }}
35-
username: ${{ github.actor }}
36-
password: ${{ secrets.GITHUB_TOKEN }}
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
3735

3836
- name: Extract metadata (tags, labels)
3937
id: meta
4038
uses: docker/metadata-action@v5
4139
with:
42-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40+
images: ${{ env.DOCKERHUB_IMAGE }}
4341
tags: |
4442
type=ref,event=branch
4543
type=ref,event=pr
@@ -61,3 +59,14 @@ jobs:
6159

6260
- name: Image digest
6361
run: echo ${{ steps.meta.outputs.digest }}
62+
63+
- name: Update Docker Hub description
64+
if: github.event_name != 'pull_request'
65+
uses: peter-evans/dockerhub-description@v3
66+
with:
67+
username: ${{ secrets.DOCKERHUB_USERNAME }}
68+
password: ${{ secrets.DOCKERHUB_TOKEN }}
69+
repository: ${{ env.DOCKERHUB_IMAGE }}
70+
short-description: "🚀 Unified AI coding environment with VSCode Server, Claude Code, Vibe-Kanban, OpenCode/Sisyphus"
71+
readme-filepath: ./README.md
72+

DOCKERHUB_SETUP.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Docker Hub 配置指南
2+
3+
## 📦 设置 Docker Hub 自动推送
4+
5+
### 步骤 1: 创建 Docker Hub 账号
6+
7+
1. 访问 [Docker Hub](https://hub.docker.com/)
8+
2. 注册或登录账号
9+
3. 记住您的用户名(例如:`chenjingxiong`
10+
11+
### 步骤 2: 创建 Access Token
12+
13+
1. 登录 Docker Hub
14+
2. 点击右上角头像 → **Account Settings**
15+
3. 选择 **Security** 标签
16+
4. 点击 **New Access Token**
17+
5. 填写信息:
18+
- Token description: `GitHub Actions - AI_Coder_AllInOne`
19+
- Access permissions: **Read, Write, Delete**
20+
6. 点击 **Generate**
21+
7. **复制并保存** token(只显示一次!)
22+
23+
### 步骤 3: 在 GitHub 仓库添加 Secrets
24+
25+
1. 访问您的 GitHub 仓库: `https://github.com/chenjingxiong/AI_Coder_AllInOne`
26+
2. 进入 **Settings****Secrets and variables****Actions**
27+
3. 点击 **New repository secret**
28+
29+
添加两个 secrets:
30+
31+
#### Secret 1: DOCKERHUB_USERNAME
32+
- Name: `DOCKERHUB_USERNAME`
33+
- Value: 您的 Docker Hub 用户名(例如:`chenjingxiong`
34+
35+
#### Secret 2: DOCKERHUB_TOKEN
36+
- Name: `DOCKERHUB_TOKEN`
37+
- Value: 刚才创建的 Access Token
38+
39+
### 步骤 4: 推送代码触发构建
40+
41+
```bash
42+
git add .
43+
git commit -m "Update workflow to push to Docker Hub"
44+
git push origin main
45+
```
46+
47+
### 步骤 5: 查看构建状态
48+
49+
1. 进入 GitHub 仓库的 **Actions** 标签
50+
2. 查看 "Docker Build and Push to Docker Hub" 工作流
51+
3. 等待构建完成(约 10-15 分钟)
52+
53+
### 步骤 6: 验证镜像
54+
55+
构建成功后,镜像将发布到:
56+
57+
```
58+
docker.io/chenjingxiong/ai-coder-allinone:latest
59+
```
60+
61+
任何人都可以拉取:
62+
63+
```bash
64+
docker pull chenjingxiong/ai-coder-allinone:latest
65+
docker run -d -p 8080:8080 chenjingxiong/ai-coder-allinone:latest
66+
```
67+
68+
## 🎯 自动化功能
69+
70+
GitHub Actions 会自动:
71+
72+
- ✅ 在每次推送到 `main` 分支时构建
73+
- ✅ 构建多架构镜像(AMD64 + ARM64)
74+
- ✅ 推送到 Docker Hub
75+
- ✅ 自动标记 `latest` 和版本号
76+
- ✅ 更新 Docker Hub 仓库描述
77+
78+
## 🏷️ 版本标记
79+
80+
### 自动标记
81+
82+
- `latest` - 最新的 main 分支构建
83+
- `main` - main 分支的最新提交
84+
- `main-<sha>` - 特定提交的构建
85+
86+
### 发布版本
87+
88+
创建版本标签:
89+
90+
```bash
91+
git tag -a v1.0.0 -m "Release v1.0.0"
92+
git push origin v1.0.0
93+
```
94+
95+
将自动创建标签:
96+
- `v1.0.0`
97+
- `1.0`
98+
- `latest`
99+
100+
## 🔍 故障排查
101+
102+
### 构建失败
103+
104+
1. 检查 Secrets 是否正确设置
105+
2. 确认 Docker Hub token 有效
106+
3. 查看 Actions 日志获取详细错误
107+
108+
### 镜像未出现在 Docker Hub
109+
110+
1. 确认构建成功完成
111+
2. 检查 Docker Hub 仓库是否存在
112+
3. 可能需要手动创建仓库(首次推送会自动创建)
113+
114+
## 📊 镜像信息
115+
116+
- **仓库**: `chenjingxiong/ai-coder-allinone`
117+
- **标签**: `latest`, `main`, 版本号
118+
- **架构**: `linux/amd64`, `linux/arm64`
119+
- **大小**: 约 2-3 GB
120+
121+
---
122+
123+
**配置完成后,每次推送代码都会自动构建并发布到 Docker Hub!** 🚀

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# AI Coder All-in-One 🚀
22

3-
[![Docker Build](https://github.com/YOUR_USERNAME/AI_Coder_AllInOne/actions/workflows/docker-build.yml/badge.svg)](https://github.com/YOUR_USERNAME/AI_Coder_AllInOne/actions/workflows/docker-build.yml)
3+
[![Docker Build](https://github.com/chenjingxiong/AI_Coder_AllInOne/actions/workflows/docker-build.yml/badge.svg)](https://github.com/chenjingxiong/AI_Coder_AllInOne/actions/workflows/docker-build.yml)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![Docker Pulls](https://img.shields.io/docker/pulls/YOUR_USERNAME/ai-coder-allinone)](https://github.com/YOUR_USERNAME/AI_Coder_AllInOne/pkgs/container/ai_coder_allinone)
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/chenjingxiong/ai-coder-allinone)](https://hub.docker.com/r/chenjingxiong/ai-coder-allinone)
6+
[![Docker Image Size](https://img.shields.io/docker/image-size/chenjingxiong/ai-coder-allinone/latest)](https://hub.docker.com/r/chenjingxiong/ai-coder-allinone)
67

78
> A unified Docker environment containing multiple AI coding tools - VSCode Server, Claude Code, Vibe-Kanban, OpenCode/Sisyphus, Open Interpreter, and Kilo-Code.
89
@@ -14,11 +15,11 @@ A unified Docker environment containing multiple AI coding tools.
1415

1516
## ⚡ Quick Start
1617

17-
### Option 1: Pull from GitHub Container Registry (Recommended)
18+
### Option 1: Pull from Docker Hub (Recommended)
1819

1920
```bash
2021
# Pull the pre-built image
21-
docker pull ghcr.io/YOUR_USERNAME/ai_coder_allinone:latest
22+
docker pull chenjingxiong/ai-coder-allinone:latest
2223

2324
# Run the container
2425
docker run -d -p 8080:8080 \
@@ -27,7 +28,7 @@ docker run -d -p 8080:8080 \
2728
-e OPENAI_API_KEY=your_key \
2829
-e GOOGLE_API_KEY=your_key \
2930
--name ai-coder \
30-
ghcr.io/YOUR_USERNAME/ai_coder_allinone:latest
31+
chenjingxiong/ai-coder-allinone:latest
3132

3233
# Open VSCode in browser
3334
# http://localhost:8080

0 commit comments

Comments
 (0)