1
0

add operator

This commit is contained in:
2022-08-15 13:43:04 +08:00
parent d2aee92357
commit 9ba33d64d3
15 changed files with 1400 additions and 0 deletions

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM golang:1.20-alpine as build
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN GOPROXY=goproxy.cn go mod download
# Copy the go source
COPY cmd/ cmd/
COPY pkg/ pkg/
ARG LDFLAGS
ARG TARGETARCH
# Build
RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build -trimpath -ldflags "$LDFLAGS" -o manager -v cmd/main.go
FROM scratch
COPY --from=build /workspace/manager /
USER 65532:65532
ENTRYPOINT ["/manager"]