-
Notifications
You must be signed in to change notification settings - Fork 308
/
Makefile
24 lines (20 loc) · 883 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Definitions
# support x86、arm macos or x86 linux
DockerBuild = docker build
DockerRun = docker run
ifeq ($(shell uname -p),arm)
DockerBuild = docker buildx build --platform=linux/amd64
DockerRun = docker run --platform=linux/amd64
endif
# Definitions
IMAGE := registry.cn-hangzhou.aliyuncs.com/acs/gpushare-scheduler-extender
GIT_VERSION := $(shell git rev-parse --short=7 HEAD)
COMMIT_ID := $(shell git describe --match=NeVeRmAtCh --abbrev=99 --tags --always --dirty)
GOLANG_DOCKER_IMAGE := golang:1.19
build-server:
go build -o bin/gpushare-sche-extender ./cmd/main.go
build-image:
${DockerBuild} -t ${IMAGE}:${GIT_VERSION} -f scripts/build/Dockerfile .
local-build-image:
GOOS=linux GOARCH=amd64 go build -o bin/gpushare-sche-extender ./cmd/main.go
${DockerBuild} -t ${IMAGE}:${GIT_VERSION} -f scripts/build/Dockerfile-local .