From a9c84e129da2d74bee821619ee7f394165a363b2 Mon Sep 17 00:00:00 2001 From: docktermj Date: Wed, 6 Dec 2023 16:07:18 -0500 Subject: [PATCH] #111 Better support for arm64 --- .github/workflows/make-go-github-file.yaml | 1 - Dockerfile | 13 ++++++------ makefiles/darwin.mk | 4 ---- makefiles/linux.mk | 4 ---- makefiles/linux_arm64.mk | 2 ++ makefiles/linux_x86_64.mk | 2 ++ makefiles/osdetect.mk | 24 ++++------------------ makefiles/windows.mk | 5 ----- package.Dockerfile | 4 ++-- 9 files changed, 16 insertions(+), 43 deletions(-) diff --git a/.github/workflows/make-go-github-file.yaml b/.github/workflows/make-go-github-file.yaml index a01cde6..882c109 100644 --- a/.github/workflows/make-go-github-file.yaml +++ b/.github/workflows/make-go-github-file.yaml @@ -1,5 +1,4 @@ --- - name: make-go-github-file.yaml on: diff --git a/Dockerfile b/Dockerfile index 679b242..13653ef 100755 --- a/Dockerfile +++ b/Dockerfile @@ -2,22 +2,21 @@ # Stages # ----------------------------------------------------------------------------- -ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime:3.7.1 -ARG IMAGE_GO_BUILDER=golang:1.21.0-bullseye -ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.7.1 +ARG IMAGE_GO_BUILDER=golang:1.21.4-bullseye +ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.8.0 # ----------------------------------------------------------------------------- # Stage: senzingapi_runtime # ----------------------------------------------------------------------------- -FROM ${IMAGE_SENZINGAPI_RUNTIME} as senzingapi_runtime +FROM ${IMAGE_FINAL} as senzingapi_runtime # ----------------------------------------------------------------------------- # Stage: go_builder # ----------------------------------------------------------------------------- FROM ${IMAGE_GO_BUILDER} as go_builder -ENV REFRESHED_AT=2023-10-02 +ENV REFRESHED_AT=2023-12-04 LABEL Name="senzing/template-go-builder" \ Maintainer="support@senzing.com" \ Version="0.0.1" @@ -51,7 +50,7 @@ RUN mkdir -p /output \ # ----------------------------------------------------------------------------- FROM ${IMAGE_FINAL} as final -ENV REFRESHED_AT=2023-08-01 +ENV REFRESHED_AT=2023-12-04 LABEL Name="senzing/template-go" \ Maintainer="support@senzing.com" \ Version="0.0.1" @@ -62,7 +61,7 @@ COPY ./rootfs / # Copy files from prior stage. -COPY --from=go_builder "/output/linux-amd64/template-go" "/app/template-go" +COPY --from=go_builder "/output/linux/template-go" "/app/template-go" # Runtime environment variables. diff --git a/makefiles/darwin.mk b/makefiles/darwin.mk index 0297f33..6cfec99 100644 --- a/makefiles/darwin.mk +++ b/makefiles/darwin.mk @@ -14,10 +14,6 @@ DYLD_LIBRARY_PATH := $(LD_LIBRARY_PATH) # OS specific targets # ----------------------------------------------------------------------------- -.PHONY: build-osarch-specific -build-osarch-specific: darwin/amd64 - - .PHONY: clean-osarch-specific clean-osarch-specific: @docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true diff --git a/makefiles/linux.mk b/makefiles/linux.mk index 34a4eb2..ef93b2d 100644 --- a/makefiles/linux.mk +++ b/makefiles/linux.mk @@ -9,10 +9,6 @@ # OS specific targets # ----------------------------------------------------------------------------- -.PHONY: build-osarch-specific -build-osarch-specific: linux/amd64 - - .PHONY: clean-osarch-specific clean-osarch-specific: @docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true diff --git a/makefiles/linux_arm64.mk b/makefiles/linux_arm64.mk index 9d0bcb1..88cf0ed 100644 --- a/makefiles/linux_arm64.mk +++ b/makefiles/linux_arm64.mk @@ -6,6 +6,8 @@ .PHONY: build-osarch-specific build-osarch-specific: linux/arm64 + @mkdir -p $(TARGET_DIRECTORY)/linux + @cp $(TARGET_DIRECTORY)/linux-arm64/$(PROGRAM_NAME) $(TARGET_DIRECTORY)/linux/$(PROGRAM_NAME) # ----------------------------------------------------------------------------- # Makefile targets supported only by this platform. diff --git a/makefiles/linux_x86_64.mk b/makefiles/linux_x86_64.mk index cd36983..890ae03 100644 --- a/makefiles/linux_x86_64.mk +++ b/makefiles/linux_x86_64.mk @@ -6,6 +6,8 @@ .PHONY: build-osarch-specific build-osarch-specific: linux/amd64 + @mkdir -p $(TARGET_DIRECTORY)/linux + @cp $(TARGET_DIRECTORY)/linux-amd64/$(PROGRAM_NAME) $(TARGET_DIRECTORY)/linux/$(PROGRAM_NAME) # ----------------------------------------------------------------------------- # Makefile targets supported only by this platform. diff --git a/makefiles/osdetect.mk b/makefiles/osdetect.mk index 7838924..3c438cb 100644 --- a/makefiles/osdetect.mk +++ b/makefiles/osdetect.mk @@ -7,25 +7,9 @@ ifeq ($(OS),Windows_NT) OSARCH = arm4 endif else - UNAME_OSTYPE = $(shell uname -s) - ifeq ($(UNAME_OSTYPE),Linux) - OSTYPE = linux - UNAME_ARCH = $(shell uname -p) - ifeq ($(UNAME_ARCH),x86_64) - OSARCH = x86_64 - endif - ifeq ($(UNAME_ARCH),arm64) - OSARCH = arm64 - endif - endif - ifeq ($(UNAME_OSTYPE),Darwin) - OSTYPE = darwin - UNAME_ARCH = $(shell uname -m) - ifeq ($(UNAME_ARCH),x86_64) - OSARCH = x86_64 - endif - ifeq ($(UNAME_ARCH),arm64) - OSARCH = arm64 - endif + OSTYPE = $(shell uname -s | tr '[:upper:]' '[:lower:]') + OSARCH = $(shell uname -m | tr '[:upper:]' '[:lower:]') + ifeq ($(OSARCH),aarch64) + OSARCH = arm64 endif endif diff --git a/makefiles/windows.mk b/makefiles/windows.mk index 156afa6..2db43cf 100644 --- a/makefiles/windows.mk +++ b/makefiles/windows.mk @@ -9,11 +9,6 @@ # OS specific targets # ----------------------------------------------------------------------------- -.PHONY: build-osarch-specific -build-osarch-specific: windows/amd64 - @mv $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME) $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME).exe - - .PHONY: clean-osarch-specific clean-osarch-specific: del /F /S /Q $(TARGET_DIRECTORY) diff --git a/package.Dockerfile b/package.Dockerfile index 4fd30e8..39ab863 100755 --- a/package.Dockerfile +++ b/package.Dockerfile @@ -2,8 +2,8 @@ # Stages # ----------------------------------------------------------------------------- -ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime:3.6.0 -ARG IMAGE_GO_BUILDER=golang:1.21.0-bullseye +ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime:3.8.0 +ARG IMAGE_GO_BUILDER=golang:1.21.4-bullseye ARG IMAGE_FPM_BUILDER=dockter/fpm:latest ARG IMAGE_FINAL=alpine