@@ -25,6 +25,16 @@ IMAGE_TAG_BASE ?= $(IMAGE_REGISTRY)/$(PROJECT_NAME)
2525SIM_TAG ?= dev
2626IMG = $(IMAGE_TAG_BASE ) :$(SIM_TAG )
2727
28+ ifeq ($(TARGETOS ) ,darwin)
29+ ifeq ($(TARGETARCH ) ,amd64)
30+ TOKENIZER_ARCH = x86_64
31+ else
32+ TOKENIZER_ARCH = $(TARGETARCH )
33+ endif
34+ else
35+ TOKENIZER_ARCH = $(TARGETARCH )
36+ endif
37+
2838CONTAINER_TOOL := $(shell { command -v docker >/dev/null 2>&1 && echo docker; } || { command -v podman >/dev/null 2>&1 && echo podman; } || echo "")
2939BUILDER := $(shell command -v buildah >/dev/null 2>&1 && echo buildah || echo $(CONTAINER_TOOL ) )
3040PLATFORMS ?= linux/amd64 # linux/arm64 # linux/s390x,linux/ppc64le
@@ -48,7 +58,7 @@ $(TOKENIZER_LIB):
4858 # # Download the HuggingFace tokenizer bindings.
4959 @echo " Downloading HuggingFace tokenizer bindings for version $( TOKENIZER_VERSION) ..."
5060 mkdir -p lib
51- curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION ) /libtokenizers.$(TARGETOS ) -$(TARGETARCH ) .tar.gz | tar -xz -C lib
61+ curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION ) /libtokenizers.$(TARGETOS ) -$(TOKENIZER_ARCH ) .tar.gz | tar -xz -C lib
5262 ranlib lib/* .a
5363
5464# #@ Development
@@ -92,8 +102,8 @@ build: check-go download-tokenizer download-zmq
92102image-build : check-container-tool # # Build Docker image ## Build Docker image using $(CONTAINER_TOOL)
93103 @printf " \033[33;1m==== Building Docker image $( IMG) ====\033[0m\n"
94104 $(CONTAINER_TOOL ) build \
95- --platform $( TARGETOS ) /$(TARGETARCH ) \
96- --build-arg TARGETOS=$( TARGETOS ) \
105+ --platform linux /$(TARGETARCH ) \
106+ --build-arg TARGETOS=linux \
97107 --build-arg TARGETARCH=$(TARGETARCH)\
98108 -t $(IMG) .
99109
0 commit comments