-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
26 lines (21 loc) · 875 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
25
26
OS ?= $(shell uname | awk '{print tolower($0)}')
ARCH ?= $(shell uname -m)
VERSION = $(shell cat VERSION)
IMAGE_REPO ?= localhost:5000
IMAGE_NAME ?= imagesync
build: VERSION
docker build \
--platform $(ARCH) \
-t $(IMAGE_REPO)/imagesync:$(VERSION)-$(ARCH) \
-f Dockerfile.$(ARCH) .
push-image: VERSION
docker push $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)-$(ARCH)
push-latest-tag-version: VERSION
docker tag $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)-$(ARCH) $(IMAGE_REPO)/$(IMAGE_NAME):latest
docker tag $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)-$(ARCH) $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)
docker push $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)
docker push $(IMAGE_REPO)/$(IMAGE_NAME):latest
artifact: build
mkdir -p _build/
docker save -o _build/imagesync.tar $(IMAGE_REPO)/$(IMAGE_NAME):$(VERSION)-$(ARCH)
.PHONY: build artifact push-image push-latest-tag-version