@@ -4,6 +4,7 @@ ARCH_TYPE ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH)))
44GOOS ?= $(shell go env GOOS)
55GOARCH ?= $(shell go env GOARCH)
66TAGS ?= godror
7+ PLATFORM ?= amd64
78DOCKER_TARGET ?= exporter-godror
89CGO_ENABLED ?= 1
910VERSION ?= 2.2.0
@@ -91,11 +92,24 @@ clean:
9192push-images :
9293 @make --no-print-directory push-oraclelinux-image
9394
94- docker :
95- docker build --no-cache --target=$(DOCKER_TARGET ) --progress=plain $(BUILD_ARGS ) -t " $( IMAGE_ID) -amd64" --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE ) --build-arg GOARCH=amd64 .
95+ docker : docker-amd
9696
9797docker-arm :
98- docker buildx build --target=$(DOCKER_TARGET ) --platform linux/arm64 --load --no-cache --progress=plain $(BUILD_ARGS ) -t " $( IMAGE_ID) -arm64" --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE ) --build-arg GOARCH=arm64 .
98+ @$(MAKE ) PLATFORM=arm64 docker-platform
99+
100+ docker-amd :
101+ @$(MAKE ) PLATFORM=amd64 docker-platform
102+
103+ docker-platform :
104+ @echo " Building Docker image for $( PLATFORM) ..."
105+ docker build --no-cache --target=$(DOCKER_TARGET ) \
106+ --platform linux/$(PLATFORM ) \
107+ --progress=plain $(BUILD_ARGS ) \
108+ -t " $( IMAGE_ID) -$( PLATFORM) " \
109+ --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE ) \
110+ --build-arg GOARCH=$(PLATFORM ) \
111+ --build-arg CGO_ENABLED=$(CGO_ENABLED ) \
112+ --build-arg TAGS=$(TAGS ) .
99113
100114push-oraclelinux-image :
101115 docker push $(IMAGE_ID )
@@ -112,4 +126,5 @@ podman-push:
112126
113127podman-release : podman-build podman-push
114128
115- .PHONY : version build deps go-test clean docker podman-build podman-push podman-release
129+ .PHONY : version build deps go-test clean docker docker-arm docker-platform docker-amd \
130+ podman-build podman-push podman-release
0 commit comments