-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 840 Bytes
/
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
# Get the tag from an external script
TAG := $(shell ./prepare_source.sh)
# DIR points to the directory with the Dockerfile to be built:
DIR ?= $(addprefix $(PWD), /x86-alpine)
DOCKER_REPO ?= couchpotato-$(shell basename $(DIR))
IMAGE_NAME ?= $(DOCKER_REPO):$(TAG)
default: build
build:
docker build -t $(IMAGE_NAME) -f $(DIR)/Dockerfile .
docker tag $(IMAGE_NAME) $(DOCKER_REPO):latest
push:
docker push $(IMAGE_NAME)
docker push $(DOCKER_REPO)
test:
docker run --rm $(IMAGE_NAME) /bin/echo "Success."
docker run --rm $(IMAGE_NAME) /usr/bin/python /CouchPotatoServer/CouchPotato.py --help
rmi:
docker rmi -f $(IMAGE_NAME)
post_checkout:
docker run --rm --privileged multiarch/qemu-user-static:register --reset
post_push:
docker tag $(IMAGE_NAME) $(DOCKER_REPO):$(TAG)
docker push $(DOCKER_REPO):$(TAG)
rebuild: rmi build