Skip to content

Commit 2e17004

Browse files
committed
feat: #9
1 parent aa5f4b4 commit 2e17004

3 files changed

Lines changed: 45 additions & 4 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,17 @@ jobs:
3737
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
3838
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
3939
40+
- name: Set up QEMU
41+
uses: docker/setup-qemu-action@v3
42+
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
4046
- name: Build and push Docker image
4147
uses: docker/build-push-action@v5
4248
with:
4349
context: .
4450
push: true
51+
platforms: linux/amd64,linux/arm64
4552
tags: ${{ steps.meta.outputs.tags }}
4653
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,27 @@ docker logs tavily-proxy 2>&1 | grep "master key"
112112
- **Windows**: `.\scripts\build_all.ps1`
113113
- **Linux/macOS**: `./scripts/build_all.sh`
114114

115-
**使用 Dockerfile 本地构建镜像**:
115+
**使用 Dockerfile 构建镜像(Buildx)**:
116+
117+
首次使用可先初始化 Buildx:
118+
119+
```bash
120+
docker buildx create --use
121+
```
122+
123+
本地构建(当前主机架构):
124+
125+
```bash
126+
docker buildx build --load -t my-tavily-proxy .
127+
```
128+
129+
构建并推送多架构镜像(`amd64` + `arm64`):
116130

117131
```bash
118-
docker build -t my-tavily-proxy .
132+
docker buildx build \
133+
--platform linux/amd64,linux/arm64 \
134+
-t ghcr.io/<owner>/<repo>:latest \
135+
--push .
119136
```
120137

121138
---

README_EN.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,27 @@ If you need to modify the code and build it yourself:
112112
- **Windows**: `.\scripts\build_all.ps1`
113113
- **Linux/macOS**: `./scripts/build_all.sh`
114114

115-
**Local Image Build with Dockerfile**:
115+
**Build Docker image with Buildx**:
116+
117+
If you use Buildx for the first time, initialize it once:
118+
119+
```bash
120+
docker buildx create --use
121+
```
122+
123+
Build locally (current host architecture):
124+
125+
```bash
126+
docker buildx build --load -t my-tavily-proxy .
127+
```
128+
129+
Build and push multi-arch image (`amd64` + `arm64`):
116130

117131
```bash
118-
docker build -t my-tavily-proxy .
132+
docker buildx build \
133+
--platform linux/amd64,linux/arm64 \
134+
-t ghcr.io/<owner>/<repo>:latest \
135+
--push .
119136
```
120137

121138
---

0 commit comments

Comments
 (0)