This commit is contained in:
Arda Güçlü
2025-08-18 13:35:24 +03:00
parent d9a05bdfd4
commit fb6987083d
5 changed files with 55 additions and 3 deletions

4
.ci-operator.yaml Normal file
View File

@@ -0,0 +1,4 @@
build_root_image:
namespace: openshift
name: release
tag: rhel-9-release-golang-1.24-openshift-4.20

40
Dockerfile.ci Normal file
View File

@@ -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"]

View File

@@ -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 /

5
Makefile-ocp.mk Normal file
View File

@@ -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

5
OWNERS Normal file
View File

@@ -0,0 +1,5 @@
reviewers:
- ardaguclu
approvers:
- ardaguclu
component: "openshift-mcp-server"