add operator
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user