Skip to content

Commit

Permalink
#111 Better support for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Dec 6, 2023
1 parent 78bcc70 commit a9c84e1
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/workflows/make-go-github-file.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

name: make-go-github-file.yaml

on:
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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.

Expand Down
4 changes: 0 additions & 4 deletions makefiles/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions makefiles/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions makefiles/linux_arm64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions makefiles/linux_x86_64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 4 additions & 20 deletions makefiles/osdetect.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions makefiles/windows.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a9c84e1

Please sign in to comment.