forked from nginx/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.containers
53 lines (47 loc) · 1.48 KB
/
Makefile.containers
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
#!/usr/bin/make -f
ifndef CONTAINER_CLITOOL
ifeq ($(shell docker -v >/dev/null 2>&1 || echo FAIL),)
CONTAINER_CLITOOL = docker
else ifeq ($(shell podman -v >/dev/null 2>&1 || echo FAIL),)
CONTAINER_CLITOOL = podman
endif
endif
ifeq ($(CONTAINER_CLITOOL), docker)
CONTAINER_BUILDENV ?= DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain
ifeq ($(shell docker-compose -v >/dev/null 2>&1 || echo FAIL),)
CONTAINER_COMPOSE = docker-compose
endif
else ifeq ($(CONTAINER_CLITOOL), podman)
ifeq ($(shell podman-compose -v >/dev/null 2>&1 || echo FAIL),)
CONTAINER_COMPOSE = podman-compose --podman-rm-args=--depend
endif
else ifdef CONTAINER_CLITOOL
CONTAINER_COMPOSE = $(error Invalid CONTAINER_CLITOOL: $(CONTAINER_CLITOOL) (supported values: docker, podman))
endif
ifdef CONTAINER_COMPOSE
CONTAINER_COMPOSETOOL = $(CONTAINER_COMPOSE)
ifeq ($(OS), linux)
CONTAINER_VOLUME_FLAGS = :z
else
CONTAINER_VOLUME_FLAGS =
endif
else
CONTAINER_COMPOSETOOL = $(error Neither docker-compose nor podman-compose found)
endif
ifeq ($(OS_RELEASE), ubuntu)
CONTAINER_OS_TYPE = deb
else ifeq ($(OS_RELEASE), debian)
CONTAINER_OS_TYPE = deb
else ifeq (${OS_RELEASE}, alpine)
CONTAINER_OS_TYPE = apk
else
CONTAINER_OS_TYPE = rpm
endif
CONTAINER_REGISTRY ?= docker.io
ifeq ($(OS_RELEASE), suse)
CONTAINER_REGISTRY = registry.suse.com
endif
ifeq ($(OS_RELEASE), redhatenterprise)
CONTAINER_REGISTRY = registry.access.redhat.com
endif
CONTAINER_VARS = CONTAINER_CLITOOL CONTAINER_COMPOSE CONTAINER_BUILDENV CONTAINER_OS_TYPE CONTAINER_REGISTRY