-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
63 lines (43 loc) · 1.16 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
-include env_make
VERSION ?= latest
REPO = wodby/rsyslog
NAME = rsyslog
TAG ?= $(VERSION)
PLATFORM ?= linux/arm64
ifneq ($(ARCH),)
override TAG := $(TAG)-$(ARCH)
endif
.PHONY: build buildx-build buildx-push buildx-imagetools-create test push shell run start stop logs clean release
default: build
build:
docker build -t $(REPO):$(VERSION) ./
buildx-build:
docker buildx build --platform $(PLATFORM) -t $(REPO):$(TAG) \
--load \
./
buildx-push:
docker buildx build --platform $(PLATFORM) --push -t $(REPO):$(TAG) \
./
buildx-imagetools-create:
docker buildx imagetools create -t $(REPO):$(TAG) \
$(REPO):$(VERSION)-amd64 \
$(REPO):$(VERSION)-arm64
.PHONY: buildx-imagetools-create
test:
echo 'no tests :('
push:
docker push $(REPO):$(VERSION)
shell:
docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(VERSION) /bin/bash
run:
docker run --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(VERSION) $(CMD)
start:
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(VERSION)
stop:
docker stop $(NAME)
logs:
docker logs $(NAME)
clean:
-docker rm -f $(NAME)
release: build
make push -e VERSION=$(VERSION)