-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mongodb multi version support (#4913)
- Loading branch information
Showing
12 changed files
with
228 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Build the kubeblocks tools binaries | ||
# includes kbcli, kubectl, and manager tools. | ||
|
||
## docker buildx build injected build-args: | ||
#BUILDPLATFORM — matches the current machine. (e.g. linux/amd64) | ||
#BUILDOS — os component of BUILDPLATFORM, e.g. linux | ||
#BUILDARCH — e.g. amd64, arm64, riscv64 | ||
#BUILDVARIANT — used to set build ARM variant, e.g. v7 | ||
#TARGETPLATFORM — The value set with --platform flag on build | ||
#TARGETOS - OS component from --platform, e.g. linux | ||
#TARGETARCH - Architecture from --platform, e.g. arm64 | ||
#TARGETVARIANT - used to set target ARM variant, e.g. v7 | ||
|
||
ARG GO_VERSION=1.20 | ||
|
||
FROM --platform=${BUILDPLATFORM} registry.cn-hangzhou.aliyuncs.com/xuriwuyun/golang:${GO_VERSION} as builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG GOPROXY | ||
ARG GOPROXY=https://goproxy.cn | ||
ARG LD_FLAGS="-s -w" | ||
|
||
ENV GONOPROXY=github.com/apecloud | ||
ENV GONOSUMDB=github.com/apecloud | ||
ENV GOPRIVATE=github.com/apecloud | ||
ENV GOPROXY=${GOPROXY} | ||
|
||
WORKDIR /src | ||
|
||
# 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 go mod download | ||
|
||
# Copy the go source | ||
#COPY internal/ internal/ | ||
#COPY controllers/ controllers/ | ||
#COPY cmd/reloader/ cmd/reloader/ | ||
#COPY cmd/probe/ cmd/probe/ | ||
#COPY externalapis/ externalapis/ | ||
#COPY version/ version/ | ||
#COPY cmd/cli/ cmd/cli/ | ||
#COPY apis/ apis/ | ||
#COPY test/testdata/testdata.go test/testdata/testdata.go | ||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go mod download | ||
# Build | ||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go env && \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -a -o /out/killer cmd/reloader/container_killer/killer.go | ||
|
||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -a -o /out/reloader cmd/reloader/main.go | ||
|
||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -a -o /out/config_render cmd/reloader/template/*.go | ||
|
||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -a -o /out/probe cmd/probe/main.go | ||
|
||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -a -o /out/sqlctl cmd/probe/sqlctl/main.go | ||
|
||
#RUN --mount=type=bind,target=. \ | ||
# --mount=type=cache,target=/root/.cache/go-build \ | ||
# --mount=type=cache,target=/go/pkg/mod \ | ||
# CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="${LD_FLAGS}" -tags="containers_image_openpgp" -a -o /out/kbcli cmd/cli/main.go | ||
|
||
# Use alpine with tag 20230329 is corresponding to "edge" tag (latest release to date is 3.18) as of 20230625 | ||
FROM docker.io/alpine:edge as dist | ||
ARG APK_MIRROR | ||
|
||
# install tools via apk | ||
# ENV APK_MIRROR=${APK_MIRROR} | ||
# RUN if [ -n "${APK_MIRROR}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories; fi | ||
# RUN apk add --no-cache curl kubectl helm --allow-untrusted \ | ||
# && rm -rf /var/cache/apk/* | ||
|
||
# copy kubeblocks tools | ||
COPY config/probe config/probe | ||
COPY --from=builder /out/killer /bin | ||
COPY --from=builder /out/reloader /bin | ||
COPY --from=builder /out/config_render /bin | ||
COPY --from=builder /out/probe /bin | ||
COPY --from=builder /out/sqlctl /bin | ||
#COPY --from=builder /out/kbcli /bin | ||
|
||
# mkdir kbcli config dir and helm cache dir. | ||
# RUN mkdir /.kbcli && chown -R 65532:65532 /.kbcli \ | ||
# && mkdir /.cache && chown -R 65532:65532 /.cache | ||
USER 65532:65532 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters