-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
39 lines (31 loc) · 1.03 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
BUILDER_IMG = imega/base-builder:1.9.2
IMAGE=imega/jq
TAG=latest
ARCH=$(shell uname -m)
ifeq ($(ARCH),aarch64)
ARCH=arm64
endif
ifeq ($(ARCH),x86_64)
ARCH=amd64
endif
build: buildfs test
@docker build -t $(IMAGE):$(TAG)-$(ARCH) .
@docker tag $(IMAGE):$(TAG)-$(ARCH) $(IMAGE):latest-$(ARCH)
buildfs:
@docker run --rm \
-v $(CURDIR)/build:/build \
$(BUILDER_IMG) \
--packages="jq@edge-main"
test:
@docker build -t $(IMAGE):test .
@echo '{"foo":10, "bar":200}' | docker run --rm -i $(IMAGE):test '.bar as $$x | .foo | . + $$x' | grep 210
login:
@docker login --username $(DOCKER_USER) --password $(DOCKER_PASS)
release: login
@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