[feat:1.18]更新本地编译时的默认镜像库及软件源地址
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Ver: 1.8 by Endial Fang (endial@126.com)
|
||||
# Ver: 1.11 by Endial Fang (endial@126.com)
|
||||
#
|
||||
# 当前 Docker 镜像的编译脚本
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
image_name :=colovu/nginx
|
||||
|
||||
# 定义默认镜像仓库地址
|
||||
registry_url :=registry.cn-shenzhen.aliyuncs.com
|
||||
registry_url :=docker.io
|
||||
|
||||
# 定义系统默认使用的源服务器,包含:default / tencent / ustc / aliyun / huawei
|
||||
apt_source :=aliyun
|
||||
apt_source :=tencent
|
||||
|
||||
# 定义镜像TAG,类似:
|
||||
# <镜像名>:<分支名>-<7位Git ID> # 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)
|
||||
@@ -25,11 +25,11 @@ 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=http://$(local_ip)/dist-files
|
||||
|
||||
.PHONY: build build clean clearclean upgrade
|
||||
.PHONY: build clean clearclean upgrade
|
||||
|
||||
build:
|
||||
@echo "Build $(image_name):$(image_tag)"
|
||||
@docker build --force-rm $(build-arg) -t $(image_name):$(image_tag) .
|
||||
@docker 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"
|
||||
|
||||
Reference in New Issue
Block a user