diff --git a/.ci-operator.yaml b/.ci-operator.yaml new file mode 100644 index 0000000..b1c5c56 --- /dev/null +++ b/.ci-operator.yaml @@ -0,0 +1,4 @@ +build_root_image: + namespace: openshift + name: release + tag: rhel-9-release-golang-1.24-openshift-4.20 \ No newline at end of file diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 0000000..e54a9df --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,40 @@ +ARG BUILDER_IMAGE=registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 +ARG BASE_IMAGE=registry.ci.openshift.org/ocp/4.20:base-rhel9 + +# Build the manager binary +FROM ${BUILDER_IMAGE} AS builder +ARG TARGETOS +ARG TARGETARCH +ARG TARGETPLATFORM + +USER 0 + +WORKDIR /workspace +COPY . . + +ENV GOEXPERIMENT=strictfipsruntime +RUN make -f Makefile-ocp.mk build-ocp GOFLAGS='-tags=strictfipsruntime -mod=vendor -a' GO_BUILD_ENV='CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH}' BINARY_NAME=openshift-mcp-server + +FROM --platform=$TARGETPLATFORM ${BASE_IMAGE} +WORKDIR / +COPY --from=builder /workspace/openshift-mcp-server . +RUN mkdir /licenses +COPY --from=builder /workspace/LICENSE /licenses/. +USER 65532:65532 + +COPY mcp_config.toml /mcp_config.toml +ENV CONFIG_PATH=/mcp_config.toml + +# Labels for enterprise contract +LABEL com.redhat.component=openshift-mcp-server +LABEL description="Red Hat OpenShift MCP Server" +LABEL io.k8s.description="Red Hat OpenShift MCP Server" +LABEL io.openshift.tags="openshift,mcp" +LABEL name=openshift-mcp-server +LABEL release=0.0.1 +LABEL url="https://github.com/openshift/openshift-mcp-server" +LABEL vendor="Red Hat, Inc." +LABEL version=0.0.1 +LABEL summary="Red Hat OpenShift MCP Server" + +ENTRYPOINT ["/openshift-mcp-server", "--config", "$CONFIG_PATH"] diff --git a/Dockerfile.ocp b/Dockerfile.ocp index 7d77f3c..b5d4040 100644 --- a/Dockerfile.ocp +++ b/Dockerfile.ocp @@ -13,9 +13,7 @@ WORKDIR /workspace COPY . . ENV GOEXPERIMENT=strictfipsruntime -ENV COMMON_BUILD_ARGS="-tags=strictfipsruntime -mod=vendor -a" -ENV BINARY_NAME=openshift-mcp-server -RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make build +RUN make -f Makefile-ocp.mk build-ocp GOFLAGS='-tags=strictfipsruntime -mod=vendor -a' GO_BUILD_ENV='CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH}' BINARY_NAME=openshift-mcp-server FROM --platform=$TARGETPLATFORM ${BASE_IMAGE} WORKDIR / diff --git a/Makefile-ocp.mk b/Makefile-ocp.mk new file mode 100644 index 0000000..acffc79 --- /dev/null +++ b/Makefile-ocp.mk @@ -0,0 +1,5 @@ +include Makefile + +.PHONY: build-ocp +build-ocp: clean format + $(GO_BUILD_ENV) go build $(COMMON_BUILD_ARGS) $(GOFLAGS) -o $(BINARY_NAME) ./cmd/kubernetes-mcp-server \ No newline at end of file diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..abb6b94 --- /dev/null +++ b/OWNERS @@ -0,0 +1,5 @@ +reviewers: + - ardaguclu +approvers: + - ardaguclu +component: "openshift-mcp-server" \ No newline at end of file