移动Dockerfile.cotroller-manager位置
• 添加了controller-manager的README.md
This commit is contained in:
@@ -2,6 +2,9 @@ FROM golang:1.23 AS builder
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# 创建临时目录结构
|
||||
RUN mkdir -p modules/k8s
|
||||
|
||||
# Copy the Go Modules manifests
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
@@ -17,7 +20,7 @@ ENV GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download
|
||||
|
||||
# Copy the Go source code
|
||||
COPY . .
|
||||
COPY modules/k8s/ modules/k8s/
|
||||
|
||||
# Build the controller-manager binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o controller-manager modules/k8s/cmd/controller-manager/controller-manager.go
|
||||
21
modules/k8s/README.md
Normal file
21
modules/k8s/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# DevStar Controller Manager
|
||||
|
||||
本目录包含 DevStar Controller Manager 的源代码和构建所需的 Dockerfile。Controller Manager 负责管理 Kubernetes 中的 DevContainer 自定义资源。
|
||||
|
||||
## 构建 Docker 镜像
|
||||
|
||||
### 构建方法
|
||||
|
||||
由于项目结构原因,构建 Docker 镜像必须从项目根目录执行:
|
||||
|
||||
```bash
|
||||
# 切换到项目根目录
|
||||
|
||||
# 构建镜像
|
||||
docker build -f modules/k8s/Dockerfile.controller-manager -t beppeb/devstar-controller-manager:[标签] .
|
||||
|
||||
# 推送镜像
|
||||
docker push beppeb/devstar-controller-manager:[标签]
|
||||
```
|
||||
|
||||
此镜像由devstar的helm chart的子chart devstar-controller-manager使用,若要使用新的镜像请修改helm chart中的values.yaml
|
||||
Reference in New Issue
Block a user