save/restore toolchain image as tgz for up to 3x disk savings

This commit is contained in:
Lance Vick 2023-09-27 14:49:17 -07:00
parent 7d2bc3d6f8
commit bba9553c2f
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 4 additions and 4 deletions

View File

@ -216,7 +216,7 @@ $(CACHE_DIR_ROOT)/container.env: \
$(shell cat cache/toolchain.state 2> /dev/null) \
$(SRC_DIR)/toolchain/scripts/environment > $@
$(CACHE_DIR_ROOT)/toolchain.tar: \
$(CACHE_DIR_ROOT)/toolchain.tgz: \
$(CONFIG_DIR)/make.env \
$(SRC_DIR)/toolchain/Dockerfile \
$(CONFIG_DIR)/apt-base.list \
@ -235,11 +235,11 @@ $(CACHE_DIR_ROOT)/toolchain.tar: \
--platform=linux/$(ARCH) \
-f $(SRC_DIR)/toolchain/Dockerfile \
.
docker save "$(IMAGE)" -o "$@"
docker save "$(IMAGE)" | gzip > "$@"
$(CACHE_DIR_ROOT)/toolchain.state: \
$(CACHE_DIR_ROOT)/toolchain.tar
docker load -i $(CACHE_DIR_ROOT)/toolchain.tar
$(CACHE_DIR_ROOT)/toolchain.tgz
docker load -i $(CACHE_DIR_ROOT)/toolchain.tgz
docker images --no-trunc --quiet $(IMAGE) > $@
$(OUT_DIR)/release.env: $(shell git ls-files)