mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-18 18:56:24 +00:00
Default to using a cache dir in ~/cache/resin-supervisor whilst building - when building without a cache volume we get the cache included in the image as well! :(
This commit is contained in:
parent
3b2b75998e
commit
567784b3e9
5
Makefile
5
Makefile
@ -11,7 +11,7 @@ BUILDSTEP_VERSION = master
|
|||||||
BUILDSTEP_REPO = resin/rpi-buildstep-armv6hf
|
BUILDSTEP_REPO = resin/rpi-buildstep-armv6hf
|
||||||
|
|
||||||
# This allows using a cache for building the supervisor, making it much faster.
|
# This allows using a cache for building the supervisor, making it much faster.
|
||||||
CACHE_VOLUME = # --volume /home/vagrant/cache:/cache
|
CACHE_VOLUME = ~/cache/resin-supervisor
|
||||||
|
|
||||||
all: supervisor
|
all: supervisor
|
||||||
|
|
||||||
@ -26,6 +26,7 @@ ifeq "$(ARCH)" "rpi"
|
|||||||
-docker rmi resin/supervisor-base:latest
|
-docker rmi resin/supervisor-base:latest
|
||||||
-docker rmi resin/supervisor-base:$(BUILDSTEP_VERSION)
|
-docker rmi resin/supervisor-base:$(BUILDSTEP_VERSION)
|
||||||
-docker rm buildstep-accelerator-$(BUILDSTEP_VERSION) 2> /dev/null
|
-docker rm buildstep-accelerator-$(BUILDSTEP_VERSION) 2> /dev/null
|
||||||
|
-rm -rf $(CACHE_VOLUME)
|
||||||
@echo "Older images cleaned."
|
@echo "Older images cleaned."
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ ifeq ($(ACCELERATOR) , )
|
|||||||
docker run --name=buildstep-accelerator-$(BUILDSTEP_VERSION) -v /.a resin/rpi-buildstep-accelerator:$(BUILDSTEP_VERSION) /prepare-accelerator.sh
|
docker run --name=buildstep-accelerator-$(BUILDSTEP_VERSION) -v /.a resin/rpi-buildstep-accelerator:$(BUILDSTEP_VERSION) /prepare-accelerator.sh
|
||||||
endif
|
endif
|
||||||
-docker rm -f build-supervisor-latest 2> /dev/null
|
-docker rm -f build-supervisor-latest 2> /dev/null
|
||||||
docker run --name build-supervisor-latest $(CACHE_VOLUME) --volumes-from `docker ps --all | grep buildstep-accelerator-$(BUILDSTEP_VERSION) | awk '{print $$1}'`:ro --env VERSION=`jq -r .version package.json` -v `pwd`:/tmp/app resin/supervisor-base:latest bash -i -c ". /.env && cp -r /tmp/app /app && /build/builder"
|
docker run --name build-supervisor-latest --volume $(CACHE_VOLUME):/cache --volumes-from `docker ps --all | grep buildstep-accelerator-$(BUILDSTEP_VERSION) | awk '{print $$1}'`:ro --env VERSION=`jq -r .version package.json` -v `pwd`:/tmp/app resin/supervisor-base:latest bash -i -c ". /.env && cp -r /tmp/app /app && /build/builder"
|
||||||
docker commit build-supervisor-latest $(RPI_IMAGE):$(SUPERVISOR_VERSION) > /dev/null
|
docker commit build-supervisor-latest $(RPI_IMAGE):$(SUPERVISOR_VERSION) > /dev/null
|
||||||
-docker rm build-supervisor-latest 2> /dev/null
|
-docker rm build-supervisor-latest 2> /dev/null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user