This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
69 lines (54 loc) · 2.34 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
64
65
66
67
68
69
BUILD_TAG ?= $(shell cat .git/refs/heads/master)
## DockerHub
REGISTRY ?= sapi40
.DEFAULT_GOAL := build
## build all images (in parallel) using the docker-compose.dev.yml file
## uses cache
.PHONY: build
build:
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 BUILD_TAG=latest docker-compose -f docker-compose.dev.yml build --parallel
## build all images (in parallel) using the docker-compose.dev.yml file
## skips cache
.PHONY: no-cache
no-cache:
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 BUILD_TAG=latest docker-compose -f docker-compose.dev.yml build --no-cache --parallel
## stop and remove containers & volumes related to i40-aas
.PHONY: clean
clean:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml down --volumes --rmi all --remove-orphans
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm -v --force
## removes everything created by docker-compose and prunes everything in docker
## (!!) this includes all your work with docker, not just stuff
## related to this repository (!!)
.PHONY: purge
purge:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml down --volumes --rmi all --remove-orphans
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm -v --force
yes | docker system prune --all --volumes --force
## start everything using the docker-compose.yml file
.PHONY: install
install:
docker-compose -f docker-compose.yml up --force-recreate --renew-anon-volumes
## start everything using the docker-compose.dev.yml file
.PHONY: dev
dev:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --force-recreate --renew-anon-volumes
## build and tag a single service image
.PHONY: build-%
build-%:
BUILD_TAG=$(BUILD_TAG) docker-compose -f docker-compose.dev.yml build $*
BUILD_TAG=$(BUILD_TAG) docker tag sapi40/$*:$(BUILD_TAG) $(REGISTRY)/$*:latest
BUILD_TAG=$(BUILD_TAG) docker tag sapi40/$*:$(BUILD_TAG) $(REGISTRY)/$*:$(BUILD_TAG)
## push a single service image
.PHONY: push-%
push-%:
BUILD_TAG=$(BUILD_TAG) docker push $(REGISTRY)/$*:$(BUILD_TAG)
BUILD_TAG=$(BUILD_TAG) docker push $(REGISTRY)/$*:latest
## up a specific service
.PHONY: up-%
up-%:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --force-recreate --renew-anon-volumes $*
## down a specific service
.PHONY: down-%
down-%:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm -f -s -v $*