FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/git-cnb
# 运行阶段
FROM --platform=$BUILDPLATFORM alpine:latest
RUN apk --no-cache add ca-certificates
RUN apk add --no-cache git
# Sets the working directory inside the container to /app for subsequent commands
WORKDIR /app
COPY --from=builder /app/git-cnb .
ENV PATH="/app:${PATH}"
我们目前在 Github 依赖 GitHubCI 的能力,在对异构的Docker镜像进行打包,例如 LoongArch64。
有计划将 Github 的 CI 迁移到CNB,我应该如何在 CNB 平台实现这个功能呢。