forked from satishweb/docker-doh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (38 loc) · 1.1 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
IMAGE=satishweb/doh-server
ALPINE_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
UBUNTU_PLATFORMS=linux/amd64,linux/arm/v7
WORKDIR=$(shell pwd)
TAGNAME?=$(shell curl -s https://api.github.com/repos/m13253/dns-over-https/tags|jq -r '.[0].name')
OSF?=alpine
# Set L to + for debug
L=@
UBUNTU_IMAGE=ubuntu:22.04
ALPINE_IMAGE=alpine:3.16
ifdef PUSH
EXTRA_BUILD_PARAMS = --push-images --push-git-tags
endif
ifdef LATEST
EXTRA_BUILD_PARAMS += --mark-latest
endif
ifdef NO-CACHE
EXTRA_BUILD_PARAMS += --no-cache
endif
all: build-alpine build-ubuntu
build-alpine:
$(L)./build.sh \
--image-name "${IMAGE}" \
--platforms "${ALPINE_PLATFORMS}" \
--work-dir "${WORKDIR}" \
--git-tag "${TAGNAME}-alpine" \
--docker-file "Dockerfile.alpine" \
${EXTRA_BUILD_PARAMS}
build-ubuntu:
$(L)./build.sh \
--image-name "${IMAGE}" \
--platforms "${UBUNTU_PLATFORMS}" \
--work-dir "${WORKDIR}" \
--git-tag "${TAGNAME}-ubuntu" \
--docker-file "Dockerfile.ubuntu" \
$$(echo ${EXTRA_BUILD_PARAMS}|sed 's/--mark-latest//')
test:
$(L)docker build -t ${IMAGE}:${TAGNAME} -f ./Dockerfile.${OSF} .