-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.docker
40 lines (31 loc) · 1.1 KB
/
Makefile.docker
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
# docker containers - just server for now, but admin can be
# handled as well if telemetry-admin is added to the end of
# this list
TELEMETRY_CONTAINERS = \
telemetry-server
# docker container actions
.PHONY: docker-build docker-start docker-run docker-ps docker-status docker-logs docker-stop
# Start the telemetry containers using docker
docker-build: vet
for cntr in $(TELEMETRY_CONTAINERS); do \
docker build -t $${cntr} --target $${cntr} . --build-arg telemetryRepoBranch=$(TELEMETRY_REPO_BRANCH); \
done
docker-start docker-run: docker-build
port=9999; \
for cntr in $(TELEMETRY_CONTAINERS); do \
docker run --rm -it -d -p $${port}:$${port} --name $${cntr} $${cntr}; \
port=$$(expr $${port} - 1); \
done
docker-ps docker-status:
docker ps --filter name=\^$$(echo $(TELEMETRY_CONTAINERS) | tr -s ' ' | tr ' ' '|')\$$;
docker-logs:
for cntr in $(TELEMETRY_CONTAINERS); do \
docker logs -n 100 $${cntr}; \
done
docker-stop: docker-status
-for cntr in $(TELEMETRY_CONTAINERS); do \
docker stop $${cntr}; \
done
docker-clean:
docker buildx prune -f --filter="until=24h"
clean: docker-clean