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:
cd tools/dind && docker build --no-cache=$(DISABLE_CACHE) -t resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) .
run-supervisor: supervisor-dind
-docker stop resin_supervisor_1 > /dev/null
-docker rm -f resin_supervisor_1 > /dev/null
run-supervisor: supervisor-dind stop-supervisor
cd tools/dind \
&& 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)
stop-supervisor:
# Prevent us from running out of loopback devices, as per https://github.com/jpetazzo/dind/issues/19
docker exec resin_supervisor_1 umount /var/lib/docker
docker stop resin_supervisor_1
-docker stop resin_supervisor_1 > /dev/null
# Remove volumes to prevent us from running out of loopback devices,
# as per https://github.com/jpetazzo/dind/issues/19
-docker rm -f --volumes resin_supervisor_1 > /dev/null
supervisor:
cp Dockerfile.$(ARCH) Dockerfile