From 0d0bdeb3a3cff4ba3a825dd3eab8ce127a33dff0 Mon Sep 17 00:00:00 2001 From: Justin Thomas Date: Thu, 9 Oct 2025 17:12:13 -0500 Subject: [PATCH] build: updated to allow building with podman and allow mac build on override with platform. --- Makefile | 6 ++++-- backend/Dockerfile | 10 +++++++--- backend/Makefile | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5e18c277968..562a4c6c5bc 100644 --- a/Makefile +++ b/Makefile @@ -21,15 +21,17 @@ SHA ?= $(shell if [ -d .git ]; then git show -s --format=%h; else echo "unknown_ TAG ?= $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo "local_build"; fi) IMAGE_REPO ?= "apache" VERSION = $(TAG)@$(SHA) +CONTAINER_CMD ?= docker +PLATFORM ?= linux/amd64 build-server-image: make build-server-image -C backend build-config-ui-image: - cd config-ui; docker build -t $(IMAGE_REPO)/devlake-config-ui:$(TAG) --file ./Dockerfile . + cd config-ui; $(CONTAINER_CMD) build --platform=$(PLATFORM) -t $(IMAGE_REPO)/devlake-config-ui:$(TAG) --file ./Dockerfile . build-grafana-image: - cd grafana; docker build -t $(IMAGE_REPO)/devlake-dashboard:$(TAG) --file ./backend/Dockerfile . + cd grafana; $(CONTAINER_CMD) build --platform=$(PLATFORM) -t $(IMAGE_REPO)/devlake-dashboard:$(TAG) --file ./Dockerfile . build-images: build-server-image build-config-ui-image build-grafana-image diff --git a/backend/Dockerfile b/backend/Dockerfile index c93b30c6a3f..9cba31da64a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -69,13 +69,17 @@ RUN for arch in aarch64 x86_64 ; do \ if [ "$arch" = "aarch64" ] ; then \ cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-arm64 \ - -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \ + -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} \ + -DCMAKE_C_FLAGS="-Wno-incompatible-pointer-types" \ + -DUSE_BUNDLED_ZLIB=ON ; \ elif [ "$arch" = "x86_64" ] ; then \ cmake .. -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc \ -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-amd64 \ - -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \ + -DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} \ + -DCMAKE_C_FLAGS="-Wno-incompatible-pointer-types" \ + -DUSE_BUNDLED_ZLIB=ON ; \ fi && \ - make -j install ; \ + make install -j ; \ done diff --git a/backend/Makefile b/backend/Makefile index 6a30e8a1347..33fcc93b497 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -22,6 +22,8 @@ TAG ?= $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo "local_b IMAGE_REPO ?= "apache" VERSION = $(TAG)@$(SHA) PYTHON_DIR ?= "./python" +CONTAINER_CMD ?= docker +PLATFORM ?= linux/amd64 all: build @@ -106,7 +108,7 @@ clean: @rm -rf bin build-server-image: - docker build -t $(IMAGE_REPO)/devlake:$(TAG) --build-arg TAG=$(TAG) --build-arg SHA=$(SHA) --file ./Dockerfile . + $(CONTAINER_CMD) build --platform=$(PLATFORM) -t $(IMAGE_REPO)/devlake:$(TAG) --build-arg TAG=$(TAG) --build-arg SHA=$(SHA) --file ./Dockerfile . migration-script-lint: go run core/migration/linter/main.go -- $$(find . -path '**/migrationscripts/**.go')