-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (30 loc) · 1.06 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
ROOT_PASSWD?=rooting
IMAGE?=workstation
VERSION?=
docker-clean:
@echo "Remove all non running containers"
docker rm $$(docker ps -q -f status=exited)
@echo "Delete all untagged/dangling (<none>) images"
docker rmi --force $$(docker image ls -q --filter dangling=true)
# docker rmi `docker images -q -f dangling=true`
clean-containers:
docker stop $$(docker ps -aq)
docker rm $$(docker ps -aq)
# Example to clean all images
# make clean IMAGE=workstation
clean:
docker rmi -f $$(docker images --filter=reference="davidban77/netautomator:${IMAGE}*" -q)
# Example to create an specific version
# make build IMAGE=workstation VERSION=-1.0.0 ROOT_PASSWD=rooting
build-netautomator:
cd docker/${IMAGE}/ && \
docker build --build-arg root_passwd=${ROOT_PASSWD} -t davidban77/netautomator:${IMAGE}v${VERSION} . && \
cd ../../
build:
cd docker/${IMAGE}/ && \
docker build -t davidban77/${IMAGE}:${VERSION} . && \
cd ../../
# Example to push an specific version
# make push IMAGE=workstation VERSION=-1.0.0
push:
docker push davidban77/netautomator:${IMAGE}${VERSION}