diff --git a/Makefile b/Makefile index 613c71e..2ef31f2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Ver: 1.9 by Endial Fang (endial@126.com) +# Ver: 1.11 by Endial Fang (endial@126.com) # # 当前 Docker 镜像的编译脚本 @@ -13,24 +13,24 @@ REGISTRY_URL :=docker.colovu.com APT_SOURCE :=ustc # 定义镜像TAG,类似: -# <镜像名>:<分支名>-<7位Git ID> # Git 仓库且无文件修改直接编译 -# <镜像名>:<分支名>-<年月日>-<时分秒> # Git 仓库有文件修改后的编译 -# <镜像名>:latest-<年月日>-<时分秒> # 非 Git 仓库编译 +# <镜像名>:<分支名>-<7位Git ID> # Git 仓库且无文件修改直接编译 +# <镜像名>:<分支名>-<年月日>-<时分秒> # Git 仓库有文件修改后的编译 +# <镜像名>:latest-<年月日>-<时分秒> # 非 Git 仓库编译 current_subversion:=$(shell if [ ! `git status >/dev/null 2>&1` ]; then git rev-parse --short HEAD; else date +%y%m%d-%H%M%S; fi) -image_tag:=$(shell if [ ! `git status >/dev/null 2>&1` ]; then git rev-parse --abbrev-ref HEAD | sed -e 's/master/latest/'; else echo "latest"; fi)-$(current_subversion) +image_tag:=$(shell if [ ! `git status >/dev/null 2>&1` ]; then git rev-parse --abbrev-ref HEAD | sed -e 's/master/latest/' | sed -e 's/main/latest/'; else echo "latest"; fi)-$(current_subversion) build-arg:=--build-arg REGISTRY_URL=$(REGISTRY_URL) build-arg+=--build-arg APT_SOURCE=$(APT_SOURCE) # 设置本地下载服务器路径,加速调试时的本地编译速度 local_ip:=`echo "en0 eth0" | xargs -n1 ip addr show 2>/dev/null | grep inet | grep -v 127.0.0.1 | grep -v inet6 | tr "/" " " | awk '{print $$2}'` -build-arg+=--build-arg LOCAL_URL=https://local.colovu.com/dist +build-arg+=--build-arg LOCAL_URL=http://local.colovu.com/dist .PHONY: build clean clearclean upgrade build: @echo "Build $(image_name):$(image_tag)" - @docker buildx build --force-rm $(build-arg) -t $(image_name):$(image_tag) . + @docker buildx build --progress plain --force-rm $(build-arg) -t $(image_name):$(image_tag) . @echo "Add tag: $(image_name):latest" @docker tag $(image_name):$(image_tag) $(image_name):latest @echo "Build complete"