Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker build and push target for GMC #83

Merged
merged 4 commits into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading