From cd95204459101b526ac07aa87a4a3b28be9dde34 Mon Sep 17 00:00:00 2001 From: Leo6Leo <36619969+Leo6Leo@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:34:40 -0400 Subject: [PATCH 1/5] fix: rename Dockerfile --- Dockerfile.rhel7 => Dockerfile.ocp | 0 Makefile | 2 +- README.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename Dockerfile.rhel7 => Dockerfile.ocp (100%) diff --git a/Dockerfile.rhel7 b/Dockerfile.ocp similarity index 100% rename from Dockerfile.rhel7 rename to Dockerfile.ocp diff --git a/Makefile b/Makefile index 11e114f51b..9408617bad 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ IMAGE_REGISTRY?=registry.svc.ci.openshift.org # $3 - Dockerfile path # $4 - context directory for image build # It will generate target "image-$(1)" for building the image and binding it as a prerequisite to target "images". -$(call build-image,ocp-console-operator,$(IMAGE_REGISTRY)/ocp/4.5:console-operator,./Dockerfile.rhel7,.) +$(call build-image,ocp-console-operator,$(IMAGE_REGISTRY)/ocp/4.5:console-operator,./Dockerfile.ocp,.) # This will include additional actions on the update and verify targets to ensure that profile patches are applied # to manifest files diff --git a/README.md b/README.md index 91466f3d60..9c3a948f5c 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ docker build -t //console-operator: . # following: docker.io/openshift/origin-console-operator:latest # for development, you are going to push to an alternate registry. # specifically it can look something like this: -docker build -f Dockerfile.rhel7 -t quay.io/benjaminapetersen/console-operator:latest . +docker build -f Dockerfile.ocp -t quay.io/benjaminapetersen/console-operator:latest . ``` You can optionally build a specific version. From f88c192fb63159ccee382054553b40b03e634037 Mon Sep 17 00:00:00 2001 From: Leo6Leo <36619969+Leo6Leo@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:51:34 -0400 Subject: [PATCH 2/5] feat: add back the Dockerfile.rhel7 for CI compatibility --- Dockerfile.rhel7 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile.rhel7 diff --git a/Dockerfile.rhel7 b/Dockerfile.rhel7 new file mode 100644 index 0000000000..ae6e3f4de2 --- /dev/null +++ b/Dockerfile.rhel7 @@ -0,0 +1,33 @@ +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS builder +ARG TAGS=ocp +WORKDIR /go/src/github.com/openshift/console-operator +COPY . . +ENV GO_PACKAGE github.com/openshift/console-operator +RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="${TAGS}" -o console ./cmd/console + +FROM registry.ci.openshift.org/ocp/4.17:base-rhel9 +RUN useradd console-operator +USER console-operator +COPY --from=builder /go/src/github.com/openshift/console-operator/console /usr/bin/console + +# these manifests are necessary for the installer +COPY manifests /manifests/ + +# out-of-the-box quickstarts +COPY quickstarts/*.yaml /manifests/ + +# extensions manifests generated from openshift/api types +COPY vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/*.crd.yaml /manifests/ +COPY vendor/github.com/openshift/api/operator/*/zz_generated.crd-manifests/*console*.crd.yaml /manifests/ +COPY vendor/github.com/openshift/api/helm/*/zz_generated.crd-manifests/*crd.yaml /manifests/ + +LABEL io.k8s.display-name="OpenShift console-operator" \ + io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of the web console." \ + io.openshift.tags="openshift" \ + maintainer="Jakub Hadvig " + +LABEL io.openshift.release.operator true + +# entrypoint specified in 03-operator.yaml as `console-operator` +# CMD ["/usr/bin/console", "operator", "--kubeconfig", "path/to/config", "--config", "./install/config.yaml", "--v", "4"] +# CMD ["/usr/bin/console", "operator", "--v", "4"] From cea65bab92530838b57b77dc8d0025c9bfa081c5 Mon Sep 17 00:00:00 2001 From: Leo6Leo <36619969+Leo6Leo@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:52:47 -0400 Subject: [PATCH 3/5] fix: update README to use placeholder for username in Docker commands --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9c3a948f5c..16847af630 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ docker build -t //console-operator: . # following: docker.io/openshift/origin-console-operator:latest # for development, you are going to push to an alternate registry. # specifically it can look something like this: -docker build -f Dockerfile.ocp -t quay.io/benjaminapetersen/console-operator:latest . +docker build -f Dockerfile.ocp -t quay.io//console-operator:latest . ``` You can optionally build a specific version. @@ -187,7 +187,7 @@ Then, push your image: ```bash docker push //console-operator: # Be sure your repository is public else the image will not be able to be pulled later -docker push quay.io/benjaminapetersen/console-operator:latest +docker push quay.io//console-operator:latest ``` Then, you will want to deploy your new container. This means duplicating the `manifests/07-operator.yaml` and updating the line `image: docker.io/openshift/origin-console-operator:latest` to instead use the @@ -206,7 +206,7 @@ image: docker.io/openshift/origin-console-operator:latest # after # image: //console-operator: replicas: 1 -image: quay.io/benjaminapetersen/console-operator:latest +image: quay.io//console-operator:latest ``` And ensure that the `imagePullPolicy` is still `Always`. This will ensure a fast development feedback loop. @@ -229,9 +229,9 @@ Which looks like the following: ```bash # build binary + container -docker build -t quay.io/benjaminapetersen/console-operator:latest . +docker build -t quay.io//console-operator:latest . # push container -docker push quay.io/benjaminapetersen/console-operator:latest +docker push quay.io//console-operator:latest # delete pod, trigger a new pull & deploy oc delete pod console-operator --namespace openshift-console-operator ``` From cd624a1fa488af6f48e4e80f9c68e0b60b8d707a Mon Sep 17 00:00:00 2001 From: Leo6Leo <36619969+Leo6Leo@users.noreply.github.com> Date: Thu, 31 Jul 2025 19:17:05 -0400 Subject: [PATCH 4/5] fix: revert Makefile to use Dockerfile.rhel7 for image build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9408617bad..11e114f51b 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ IMAGE_REGISTRY?=registry.svc.ci.openshift.org # $3 - Dockerfile path # $4 - context directory for image build # It will generate target "image-$(1)" for building the image and binding it as a prerequisite to target "images". -$(call build-image,ocp-console-operator,$(IMAGE_REGISTRY)/ocp/4.5:console-operator,./Dockerfile.ocp,.) +$(call build-image,ocp-console-operator,$(IMAGE_REGISTRY)/ocp/4.5:console-operator,./Dockerfile.rhel7,.) # This will include additional actions on the update and verify targets to ensure that profile patches are applied # to manifest files From 64dc631ef36e547f986dfe07d43ae4fc06468c5e Mon Sep 17 00:00:00 2001 From: Leo Li <36619969+Leo6Leo@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:59:08 -0400 Subject: [PATCH 5/5] Update README.md Co-authored-by: Jon Jackson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16847af630..1e7ddf7dfa 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ docker build -t //console-operator: . # following: docker.io/openshift/origin-console-operator:latest # for development, you are going to push to an alternate registry. # specifically it can look something like this: -docker build -f Dockerfile.ocp -t quay.io//console-operator:latest . +docker build -f Dockerfile.ocp -t quay.io//console-operator:latest . ``` You can optionally build a specific version.