-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (33 loc) · 1.17 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
36
37
38
39
40
41
test: build
IMAGE=$(IMAGE) TAG=$(TAG) ARCH=$(ARCH) docker-compose up -d --build --scale acceptance=0
IMAGE=$(IMAGE) TAG=$(TAG) ARCH=$(ARCH) docker-compose up --abort-on-container-exit acceptance
IMAGE=imega/consul
TAG=latest
ARCH=$(shell uname -m)
ifeq ($(ARCH),aarch64)
ARCH=arm64
endif
ifeq ($(ARCH),x86_64)
ARCH=amd64
endif
build: buildfs
@docker build -t $(IMAGE):$(TAG)-$(ARCH) .
@docker tag $(IMAGE):$(TAG)-$(ARCH) $(IMAGE):latest-$(ARCH)
buildfs:
@docker run --rm \
-v $(CURDIR)/src:/src \
-v $(CURDIR)/runner:/runner \
-v $(CURDIR)/build:/build \
imega/base-builder \
--packages="busybox bash curl jq consul@edge-community"
login:
@docker login --username $(DOCKER_USER) --password $(DOCKER_PASS)
release: login
@-docker scan $(IMAGE):$(TAG)-$(ARCH)
@docker push $(IMAGE):$(TAG)-$(ARCH)
@docker push $(IMAGE):latest-$(ARCH)
release-manifest: login
@docker manifest create $(IMAGE):$(TAG) $(IMAGE):$(TAG)-amd64 $(IMAGE):$(TAG)-ppc64le $(IMAGE):$(TAG)-arm64
@docker manifest create $(IMAGE):latest $(IMAGE):latest-amd64 $(IMAGE):latest-ppc64le $(IMAGE):latest-arm64
@docker manifest push $(IMAGE):$(TAG)
@docker manifest push $(IMAGE):latest