-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
37 lines (25 loc) · 1.27 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
DATE := $(shell date +"%Y-%m-%d")
IMAGE := jjok/mopidy
default: build-pi tag down run-bg save
upload-kitchen:
scp ./.dockerignore ./docker-compose.yml ./Dockerfile ./Makefile ./mopidy.conf ./requirements.txt [email protected]:mopidy-build/
upload-office:
scp ./.dockerignore ./docker-compose.yml ./Dockerfile ./Makefile ./mopidy.conf ./requirements.txt [email protected]:mopidy-build/
build-pc:
docker build --pull -t $(IMAGE):$(DATE) --build-arg ARCH=amd64 --build-arg BUILD_FROM=debian:stable-slim .
build-pi:
docker build --pull -t $(IMAGE):$(DATE) --build-arg ARCH=armhf --build-arg BUILD_FROM=balenalib/raspberry-pi:latest .
tag:
docker tag $(IMAGE):$(DATE) $(IMAGE):latest
save:
docker save $(IMAGE):$(DATE) $(IMAGE):latest > jjok_mopidy_$(shell date +"%Y_%m_%d").tar
down:
docker stop mopidy
docker rm mopidy
docker image prune -f
run-fg:
docker run --name mopidy --device /dev/snd -p 6600:6600 -p 6680:6680 -v /home/$(USER)/music:/root/music --rm -it $(IMAGE):latest
run-bg:
docker run --name mopidy --device /dev/snd --net host -v /home/$(USER)/music:/root/music --restart=unless-stopped -d $(IMAGE):latest
sync-music:
rsync -ahvP --recursive --files-from=music.txt /media/jonathan/77B9-F955/music/ [email protected]:music/