Better volume handling

This commit is contained in:
Pablo Carranza Vélez 2015-07-16 20:12:09 +00:00
parent fb019d7192
commit f87c4915da

View File

@ -16,17 +16,16 @@ clean:
supervisor-dind: supervisor-dind:
cd tools/dind && docker build --no-cache=$(DISABLE_CACHE) -t resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) . cd tools/dind && docker build --no-cache=$(DISABLE_CACHE) -t resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) .
run-supervisor: supervisor-dind run-supervisor: supervisor-dind stop-supervisor
-docker stop resin_supervisor_1 > /dev/null
-docker rm -f resin_supervisor_1 > /dev/null
cd tools/dind \ cd tools/dind \
&& sed --in-place -e "s|SUPERVISOR_IMAGE=.*|SUPERVISOR_IMAGE=$(DEPLOY_REGISTRY)$(IMAGE) |" config/env \ && sed --in-place -e "s|SUPERVISOR_IMAGE=.*|SUPERVISOR_IMAGE=$(DEPLOY_REGISTRY)$(IMAGE) |" config/env \
&& docker run -d --name resin_supervisor_1 --privileged -v $$(pwd)/config.json:/usr/src/app/config/config.json -v $$(pwd)/config/env:/usr/src/app/config/env -v /sys/fs/cgroup:/sys/fs/cgroup:ro resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) && docker run -d --name resin_supervisor_1 --privileged -v $$(pwd)/config.json:/usr/src/app/config/config.json -v $$(pwd)/config/env:/usr/src/app/config/env -v /sys/fs/cgroup:/sys/fs/cgroup:ro resin/resin-supervisor-dind:$(SUPERVISOR_VERSION)
stop-supervisor: stop-supervisor:
# Prevent us from running out of loopback devices, as per https://github.com/jpetazzo/dind/issues/19 -docker stop resin_supervisor_1 > /dev/null
docker exec resin_supervisor_1 umount /var/lib/docker # Remove volumes to prevent us from running out of loopback devices,
docker stop resin_supervisor_1 # as per https://github.com/jpetazzo/dind/issues/19
-docker rm -f --volumes resin_supervisor_1 > /dev/null
supervisor: supervisor:
cp Dockerfile.$(ARCH) Dockerfile cp Dockerfile.$(ARCH) Dockerfile