From a0604cde026cb313d45ffba04dd0a192f543b19f Mon Sep 17 00:00:00 2001 From: irisdingbj Date: Wed, 5 Jun 2024 08:46:24 -0700 Subject: [PATCH 1/3] add docker build and push target for GMC Signed-off-by: irisdingbj --- microservices-connector/Makefile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/microservices-connector/Makefile b/microservices-connector/Makefile index cb560076..96de5acb 100644 --- a/microservices-connector/Makefile +++ b/microservices-connector/Makefile @@ -2,8 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 # Image URL to use all building/pushing image targets -CTR_IMG ?= gmcmanager:latest -ROUTER_IMG ?= gmcrouter:latest +CTR_IMG ?= gmcmanager +ROUTER_IMG ?= gmcrouter +VERSION ?= latest +DOCKER_REGISTRY ?= docker.io/opea # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 @@ -111,18 +113,26 @@ run-router: manifests generate fmt vet ## Build manager and router Docker images -.PHONY: docker -docker: manager-image router-image +.PHONY: docker.build +docker.build: manager-image router-image # Build manager Docker image manager-image: @echo "Building manager Docker image..." - $(CONTAINER_TOOL) build -t ${CTR_IMG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile.manager . + $(CONTAINER_TOOL) build -t $(DOCKER_REGISTRY)/${CTR_IMG}:$(VERSION) -f Dockerfile.manager . # Build router Docker image router-image: @echo "Building router Docker image..." - $(CONTAINER_TOOL) build -t ${ROUTER_IMG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile.router . + $(CONTAINER_TOOL) build -t $(DOCKER_REGISTRY)/${ROUTER_IMG}:$(VERSION) -f Dockerfile.router . + +# Publish manger and router docker images +.PHONY: docker.push +docker.push: + @echo "Push manager Docker image..." + $(CONTAINER_TOOL) push $(DOCKER_REGISTRY)/${CTR_IMG}:$(VERSION) + @echo "Push router Docker image..." + $(CONTAINER_TOOL) push $(DOCKER_REGISTRY)/${ROUTER_IMG}:$(VERSION) ## Clean up build binaries From 865aefa55fd88a5d4ee3bffc7eb6d58352266133 Mon Sep 17 00:00:00 2001 From: irisdingbj Date: Wed, 5 Jun 2024 10:44:21 -0700 Subject: [PATCH 2/3] fix typo Signed-off-by: irisdingbj --- microservices-connector/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microservices-connector/Makefile b/microservices-connector/Makefile index 96de5acb..1fa6cc57 100644 --- a/microservices-connector/Makefile +++ b/microservices-connector/Makefile @@ -132,7 +132,7 @@ docker.push: @echo "Push manager Docker image..." $(CONTAINER_TOOL) push $(DOCKER_REGISTRY)/${CTR_IMG}:$(VERSION) @echo "Push router Docker image..." - $(CONTAINER_TOOL) push $(DOCKER_REGISTRY)/${ROUTER_IMG}:$(VERSION) + $(CONTAINER_TOOL) push $(DOCKER_REGISTRY)/${ROUTER_IMG}:$(VERSION) ## Clean up build binaries From 0be94593d84fa89d4b91a022c6ac2fb9be194b17 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:45:14 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- microservices-connector/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microservices-connector/Makefile b/microservices-connector/Makefile index 1fa6cc57..69ab07d7 100644 --- a/microservices-connector/Makefile +++ b/microservices-connector/Makefile @@ -126,7 +126,7 @@ router-image: @echo "Building router Docker image..." $(CONTAINER_TOOL) build -t $(DOCKER_REGISTRY)/${ROUTER_IMG}:$(VERSION) -f Dockerfile.router . -# Publish manger and router docker images +# Publish manager and router docker images .PHONY: docker.push docker.push: @echo "Push manager Docker image..."