x86 support + Change localImage variable to SUPERVISOR_IMAGE

This commit is contained in:
Praneeth Bodduluri 2014-08-05 16:18:19 +02:00 committed by Pablo Carranza Vélez
parent 42b3479884
commit 7aa66b5cb6
6 changed files with 28 additions and 5 deletions

14
Dockerfile.x86 Normal file
View File

@ -0,0 +1,14 @@
FROM dockerfile/nodejs
ADD . /app
WORKDIR /app
ENV SUPERVISOR_IMAGE resin/x86-supervisor
ENV CONFIG_MOUNT_POINT /boot/config.json
RUN rm -rf node_modules
RUN npm install --unsafe-perm --production
RUN ln -sf /app/entry.sh /start
CMD ["/app/entry.sh"]

View File

@ -49,5 +49,10 @@ supervisor-accelerated:
echo 'Please run make accelerator in resin-buildstep to continue'
endif
supervisor-x86:
tar --exclude="Dockerfile" --transform='flags=r;s|Dockerfile.x86|Dockerfile|' -c . | docker build -t resin/x86-supervisor -
.PHONY: supervisor supervisor-accelerated
run-supervisor-x86:
docker run --privileged -d -v /var/run/docker.sock:/run/docker.sock -e API_ENDPOINT=https://staging.resin.io -e REGISTRY_ENDPOINT=registry.staging.resin.io -e PUBNUB_SUBSCRIBE_KEY=sub-c-bananas -e PUBNUB_PUBLISH_KEY=pub-c-bananas -e MIXPANEL_TOKEN=bananasbananas resin/x86-supervisor /start
.PHONY: supervisor supervisor-accelerated supervisor-x86 run-supervisor-x86

View File

@ -8,4 +8,4 @@ fi
# System dependencies
apt-get -q update
apt-get install -qqy openvpn libsqlite3-dev python
apt-get install -qqy openvpn libsqlite3-dev

View File

@ -7,4 +7,6 @@ set -e
[ -c /dev/net/tun ] ||
mknod /dev/net/tun c 10 200
cd /app
exec node src/supervisor.js

View File

@ -6,14 +6,16 @@ module.exports = config =
publish_key: process.env.PUBNUB_PUBLISH_KEY ? 'pub-c-bananas'
mixpanelToken: process.env.MIXPANEL_TOKEN ? 'bananasbananas'
dockerSocket: process.env.DOCKER_SOCKET ? '/run/docker.sock'
supervisorContainer:
localImage: process.env.SUPERVISOR_IMAGE ? 'resin/rpi-supervisor'
configMountPoint: process.env.CONFIG_MOUNT_POINT ? '/mnt/mmcblk0p1/config.json'
config.supervisorContainer =
Volumes:
'/boot/config.json': {}
'/data': {}
'/run/docker.sock': {}
'/mnt/fib_trie': {}
Binds: [
'/mnt/mmcblk0p1/config.json:/boot/config.json'
config.configMountPoint + ':/boot/config.json'
'/var/run/docker.sock:/run/docker.sock'
'/resin-data/resin-supervisor:/data'
'/proc/net/fib_trie:/mnt/fib_trie'

View File

@ -8,7 +8,7 @@ docker = Promise.promisifyAll(new Docker(socketPath: config.dockerSocket))
Promise.promisifyAll(docker.getImage().__proto__)
Promise.promisifyAll(docker.getContainer().__proto__)
localImage = 'resin/rpi-supervisor'
localImage = config.localImage
remoteImage = config.registryEndpoint + '/' + localImage
startNewSupervisor = (currentSupervisor) ->