-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
58 lines (40 loc) · 1.15 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
-include env.mk
OPENSMTPD_VER ?= 7.5.0
OPENSMTPD_VER_MINOR := $(shell v='$(OPENSMTPD_VER)'; echo "$${v%.*}")
TAG ?= $(OPENSMTPD_VER_MINOR)
ALPINE_VER ?= 3.20
ifeq ($(BASE_IMAGE_STABILITY_TAG),)
BASE_IMAGE_TAG := $(ALPINE_VER)
else
BASE_IMAGE_TAG := $(ALPINE_VER)-$(BASE_IMAGE_STABILITY_TAG)
endif
REPO = wodby/opensmtpd
NAME = opensmtpd-$(OPENSMTPD_VER_MINOR)
ifneq ($(STABILITY_TAG),)
ifneq ($(TAG),latest)
override TAG := $(TAG)-$(STABILITY_TAG)
endif
endif
.PHONY: build test push shell run start stop logs clean release
default: build
build:
docker build -t $(REPO):$(TAG) \
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
--build-arg OPENSMTPD_VER=$(OPENSMTPD_VER) ./
test:
cd ./tests && ./run.sh $(NAME) $(REPO):$(TAG)
push:
docker push $(REPO):$(TAG)
shell:
docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash
run:
docker run --rm --name $(NAME) $(LINKS) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) $(CMD)
start:
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
stop:
docker stop $(NAME)
logs:
docker logs $(NAME)
clean:
-docker rm -f $(NAME)
release: build push