Skip to content

Commit

Permalink
add docker build and push target for GMC (opea-project#83)
Browse files Browse the repository at this point in the history
* add docker build and push target for GMC

Signed-off-by: irisdingbj <shaojun.ding@intel.com>
Signed-off-by: KfreeZ <kefei.zhang@intel.com>
  • Loading branch information
irisdingbj authored and KfreeZ committed Jun 11, 2024
1 parent 672277a commit 2cae84f
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions microservices-connector/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 manager 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
Expand Down

0 comments on commit 2cae84f

Please sign in to comment.