2016-11-15 01:01:34 +00:00
|
|
|
default: build
|
|
|
|
|
|
|
|
# Default target to build the image
|
2016-11-14 22:41:21 +00:00
|
|
|
build:
|
2016-11-15 01:01:34 +00:00
|
|
|
docker build -t rpi-homebridge-dev .
|
2016-11-14 22:41:21 +00:00
|
|
|
|
2016-12-24 03:53:12 +00:00
|
|
|
clean:
|
|
|
|
-docker kill homebridge
|
|
|
|
-docker rm homebridge
|
|
|
|
|
2016-11-15 01:01:34 +00:00
|
|
|
# Target to build and run and subsequently remove image
|
2016-11-14 22:41:21 +00:00
|
|
|
run: build
|
|
|
|
docker run --net=host --rm \
|
2016-12-24 03:53:12 +00:00
|
|
|
-p "51826:51826" \
|
2016-11-14 22:41:21 +00:00
|
|
|
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
|
|
|
|
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
|
2016-12-24 03:53:12 +00:00
|
|
|
-v "$(shell pwd)/persist:/root/.homebridge/persist" \
|
2016-11-15 01:01:34 +00:00
|
|
|
rpi-homebridge-dev
|
2016-11-14 22:41:21 +00:00
|
|
|
|
2016-11-15 01:01:34 +00:00
|
|
|
# Target to drop into an interractive shell
|
2016-11-14 22:41:21 +00:00
|
|
|
shell: build
|
|
|
|
docker run --net=host --rm \
|
2016-12-24 03:53:12 +00:00
|
|
|
-p "51826:51826" \
|
2016-11-14 22:41:21 +00:00
|
|
|
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
|
|
|
|
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
|
2016-12-24 03:53:12 +00:00
|
|
|
-v "$(shell pwd)/persist:/root/.homebridge/persist" \
|
2016-11-15 01:01:34 +00:00
|
|
|
-it rpi-homebridge-dev bash
|
|
|
|
|
2016-12-24 03:53:12 +00:00
|
|
|
# Target to buld and run in detached mode (continuously)
|
|
|
|
go: build
|
|
|
|
make clean
|
|
|
|
docker run --net=host -d \
|
|
|
|
-p "51826:51826" \
|
|
|
|
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
|
|
|
|
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
|
|
|
|
-v "$(shell pwd)/persist:/root/.homebridge/persist" \
|
|
|
|
--name homebridge \
|
|
|
|
rpi-homebridge-dev
|
|
|
|
|
2016-11-15 01:01:34 +00:00
|
|
|
# Tags dev image so it can be pushed
|
|
|
|
tag: build
|
|
|
|
docker tag rpi-homebridge-dev vividboarder/rpi-homebridge
|
|
|
|
|
|
|
|
# Pushes tagged image to docker hub
|
|
|
|
push: tag
|
|
|
|
docker push vividboarder/rpi-homebridge
|