forked from silvio/docker-matrix
-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
35 lines (27 loc) · 1.34 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
#Dockerfile vars
#vars
IMAGENAME=docker-matrix
IMAGEFULLNAME=avhost/${IMAGENAME}
TAG=$(shell git describe --tags --abbrev=0)
BRANCH=$(shell git symbolic-ref --short HEAD | xargs basename)
BRANCHSHORT=$(shell echo ${BRANCH} | awk -F. '{ print $$1"."$$2 }')
LASTCOMMIT=$(shell git log -1 --pretty=short | tail -n 1 | tr -d " " | tr -d "UPDATE:")
TAG_SYN=v1.121.0
BV_SYN=release-v1.121
BUILDDATE=$(shell date -u +%Y%m%d)
.DEFAULT_GOAL := all
ifeq (${BRANCH}, master)
BRANCH=latest
BRANCHSHORT=latest
endif
build:
@echo ">>>> Build docker image latest"
BUILDKIT_PROGRESS=plain docker buildx build --no-cache --build-arg TAG_SYN=${TAG_SYN} --build-arg BV_SYN=${BV_SYN} -t ${IMAGEFULLNAME}:latest .
push:
@echo ">>>> Publish docker image: " ${BRANCH}
@docker buildx create --use --name buildkit
@docker buildx build --sbom=true --provenance=true --platform linux/amd64 --build-arg TAG_SYN=${TAG_SYN} --build-arg BV_SYN=${BV_SYN} --push -t ${IMAGEFULLNAME}:${BRANCH} .
@docker buildx build --sbom=true --provenance=true --platform linux/amd64 --build-arg TAG_SYN=${TAG_SYN} --build-arg BV_SYN=${BV_SYN} --push -t ${IMAGEFULLNAME}:${BRANCHSHORT} .
@docker buildx build --sbom=true --provenance=true --platform linux/amd64 --build-arg TAG_SYN=${TAG_SYN} --build-arg BV_SYN=${BV_SYN} --push -t ${IMAGEFULLNAME}:latest .
@docker buildx rm buildkit
all: build