Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARCH_TYPE ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH)))
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
TAGS ?= godror
PLATFORM ?= amd64
DOCKER_TARGET ?= exporter-godror
CGO_ENABLED ?= 1
VERSION ?= 2.2.0
Expand Down Expand Up @@ -91,11 +92,24 @@ clean:
push-images:
@make --no-print-directory push-oraclelinux-image

docker:
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 .
docker: docker-amd

docker-arm:
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 .
@$(MAKE) PLATFORM=arm64 docker-platform

docker-amd:
@$(MAKE) PLATFORM=amd64 docker-platform

docker-platform:
@echo "Building Docker image for $(PLATFORM)..."
docker build --no-cache --target=$(DOCKER_TARGET) \
--platform linux/$(PLATFORM) \
--progress=plain $(BUILD_ARGS) \
-t "$(IMAGE_ID)-$(PLATFORM)" \
--build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE) \
--build-arg GOARCH=$(PLATFORM) \
--build-arg CGO_ENABLED=$(CGO_ENABLED) \
--build-arg TAGS=$(TAGS) .

push-oraclelinux-image:
docker push $(IMAGE_ID)
Expand All @@ -112,4 +126,5 @@ podman-push:

podman-release: podman-build podman-push

.PHONY: version build deps go-test clean docker podman-build podman-push podman-release
.PHONY: version build deps go-test clean docker docker-arm docker-platform docker-amd \
podman-build podman-push podman-release
4 changes: 1 addition & 3 deletions build-all-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ build_ol() {

if [[ -n "$BUILD_CONTAINERS" ]]; then
echo "Starting $OL_IMAGE-${platform} build container"
docker build --platform "linux/${platform}" --target=exporter-$TARGET -t $image_artifact \
--build-arg GO_VERSION=$GO_VERSION --build-arg TAGS=$TAGS --build-arg CGO_ENABLED=$CGO_ENABLED \
--build-arg BASE_IMAGE=$BASE_IMAGE --build-arg GOARCH=$platform --build-arg GOOS=linux --build-arg VERSION=$VERSION .
PLATFORM=$platform make docker-platform
fi

if [[ -n "BUILD_OL8" ]]; then
Expand Down