mirror of
https://github.com/ViViDboarder/docker-rpi-homebridge.git
synced 2024-12-22 09:27:37 +00:00
WIP
Really a wip right now. Playing with adding shrinkwrapping so that we can get reproducible builds
This commit is contained in:
parent
0fbd06b497
commit
52d327c0b4
37
Dockerfile
37
Dockerfile
@ -1,7 +1,8 @@
|
||||
FROM hypriot/rpi-node:8
|
||||
# FROM hypriot/rpi-node:8
|
||||
FROM node:8
|
||||
MAINTAINER ViViDboarder <vividboarder@gmail.com>
|
||||
|
||||
RUN [ "cross-build-start" ]
|
||||
# RUN [ "cross-build-start" ]
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
@ -16,26 +17,28 @@ RUN apt-get update && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN npm install -g --unsafe-perm \
|
||||
homebridge \
|
||||
hap-nodejs \
|
||||
node-gyp && \
|
||||
cd /usr/local/lib/node_modules/homebridge/ && \
|
||||
npm install --unsafe-perm bignum && \
|
||||
cd /usr/local/lib/node_modules/hap-nodejs/node_modules/mdns && \
|
||||
node-gyp BUILDTYPE=Release rebuild
|
||||
|
||||
RUN mkdir -p /var/run/dbus/
|
||||
|
||||
USER root
|
||||
RUN mkdir -p /root/.homebridge
|
||||
|
||||
RUN [ "cross-build-end" ]
|
||||
RUN mkdir -p /homebridge
|
||||
RUN mkdir -p /root/.homebridge
|
||||
VOLUME /root/.homebridge
|
||||
|
||||
RUN mkdir -p /homebridge
|
||||
WORKDIR /homebridge
|
||||
|
||||
COPY package.json /homebridge/
|
||||
COPY npm-shrinkwrap.json /homebridge/
|
||||
|
||||
RUN npm install
|
||||
|
||||
# RUN [ "cross-build-end" ]
|
||||
|
||||
EXPOSE 5353 51826
|
||||
VOLUME /root/.homebridge
|
||||
WORKDIR /root/.homebridge
|
||||
|
||||
ADD start.sh /root/.homebridge/start.sh
|
||||
COPY start.sh /homebridge/
|
||||
|
||||
CMD /root/.homebridge/start.sh
|
||||
COPY plugins-sample.txt /homebridge/plugins.txt
|
||||
|
||||
CMD /homebridge/start.sh
|
||||
|
13
Makefile
13
Makefile
@ -7,7 +7,7 @@ build:
|
||||
# Target to build and run and subsequently remove image
|
||||
run: build
|
||||
docker run --net=host --rm \
|
||||
-p "localhost:51826:51826"
|
||||
-p "51826:51826" \
|
||||
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
|
||||
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
|
||||
rpi-homebridge-dev
|
||||
@ -15,7 +15,7 @@ run: build
|
||||
# Target to drop into an interractive shell
|
||||
shell: build
|
||||
docker run --net=host --rm \
|
||||
-p "localhost:51826:51826"
|
||||
-p "51826:51826" \
|
||||
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
|
||||
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
|
||||
-it rpi-homebridge-dev bash
|
||||
@ -27,3 +27,12 @@ tag: build
|
||||
# Pushes tagged image to docker hub
|
||||
push: tag
|
||||
docker push vividboarder/rpi-homebridge
|
||||
|
||||
clean-shrinkwrap:
|
||||
echo '{}' > npm-shrinkwrap.json
|
||||
|
||||
update-shrinkwrap: clean-shrinkwrap build
|
||||
docker run --rm \
|
||||
-v "$(shell pwd)/npm-shrinkwrap.json:/homebridge/npm-shrinkwrap.json" \
|
||||
rpi-homebridge-dev npm shrinkwrap
|
||||
# rpi-homebridge-dev cp package-lock.json npm-shrinkwrap.json
|
||||
|
1
npm-shrinkwrap.json
generated
Normal file
1
npm-shrinkwrap.json
generated
Normal file
@ -0,0 +1 @@
|
||||
{}
|
10
package.json
Normal file
10
package.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "docker-rpi-homebridge",
|
||||
"version": "1.0.0",
|
||||
"description": "Meta package for installing dependencies",
|
||||
"dependencies": {
|
||||
"homebridge": "0.4.27",
|
||||
"hap-nodejs": "0.4.32",
|
||||
"node-gyp": "3.6.2"
|
||||
}
|
||||
}
|
4
start.sh
4
start.sh
@ -8,7 +8,7 @@ service dbus start
|
||||
service avahi-daemon start
|
||||
|
||||
# Install desired plugins
|
||||
cat /root/.homebridge/plugins.txt | xargs npm install -g --unsafe-perm
|
||||
cat /homebridge/plugins.txt | xargs npm install --unsafe-perm
|
||||
|
||||
# Start service
|
||||
homebridge
|
||||
/homebridge/node_modules/.bin/homebridge
|
||||
|
Loading…
Reference in New Issue
Block a user