Skip to content

Commit

Permalink
build: 添加预构建脚本并优化镜像构建过程
Browse files Browse the repository at this point in the history
- 新增 pre 目标,用于构建 Docker 镜像
- 在 pre 目标中添加了多个构建参数,包括 VERSION、GIT_COMMIT、MODEL、API_KEY 和 API_URL
- 指定平台为 linux/arm64 和 linux/amd64,以支持多架构构建
- 优化了镜像构建命令,提高了构建效率和灵活性
  • Loading branch information
weibaohui committed Jan 16, 2025
1 parent cdd34b6 commit e5a2fb5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ docker:
-t weibh/k8m:$(VERSION) -f Dockerfile . --load


# 为当前平台构建可执行文件
.PHONY: pre
pre:
@echo "构建docker镜像..."
@docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg MODEL=$(MODEL) \
--build-arg API_KEY=$(API_KEY) \
--build-arg API_URL=$(API_URL) \
--platform=linux/arm64,linux/amd64 \
-t weibh/k8m:$(VERSION) -f Dockerfile . --load



# 为当前平台构建可执行文件
.PHONY: build
Expand Down

0 comments on commit e5a2fb5

Please sign in to comment.