fix: ci failure when specifying container registration address (#424)

Signed-off-by: YuLuo <yuluo08290126@gmail.com>
This commit is contained in:
YuLuo 2024-05-09 16:19:10 +08:00 committed by GitHub
parent 9f400bbcb9
commit c2fcf50f2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,9 @@
HELM_VERSION ?= v0.0.3
# Docker repo
REGISTRY ?= docker.io/linuxsuren
REGISTRY ?= docker.io
REGISTRY_NAMESPACE ?= linuxsuren
# Set image tools
IMAGE_TOOL ?= docker

View File

@ -5,7 +5,7 @@
include tools/make/env.mk
OCI_REGISTRY ?= oci://${REGISTRY}
OCI_REGISTRY ?= oci://${REGISTRY}/${REGISTRY_NAMESPACE}
CHART_NAME ?= api-testing
CHART_VERSION ?= ${HELM_VERSION}

View File

@ -9,6 +9,7 @@ include tools/make/env.mk
IMAGES_DIR ?= $(wildcard ${ROOT_DIR}tools/docker/*)
# Determine images names by stripping out the dir names
IMAGES ?= api-testing
IMAGE_NAME ?= ${REGISTRY}/${REGISTRY_NAMESPACE}/${IMAGES}:${TAG}
ifeq (${IMAGES},)
$(error Could not determine IMAGES, set ROOT_DIR or run in source dir)
@ -24,14 +25,14 @@ image.build.%:
@$(LOG_TARGET)
@$(call log, "Building image $(GOOS)-$(GOARCH) $(IMAGES):$(TAG)")
${IMAGE_TOOL} build -f $(ROOT_DIR)/Dockerfile \
-t ${REGISTRY}/${IMAGES}:${TAG} . \
-t ${IMAGE_NAME} . \
--build-arg GOPROXY=${GOPROXY} \
--build-arg VERSION=$(TAG)
.PHONY: run.image
run.image:
@$(LOG_TARGET)
${IMAGE_TOOL} run -p 7070:7070 -p 8080:8080 ${REGISTRY}/${IMAGES}:${TAG}
${IMAGE_TOOL} run -p 7070:7070 -p 8080:8080 ${IMAGE_NAME}
##@ Image