This commit is contained in:
Jeffrey Paul 2022-12-08 20:52:38 +04:00
parent 4c345fc415
commit 0a5c99c9e0
1 changed files with 7 additions and 2 deletions

View File

@ -5,12 +5,16 @@ ARCH := $(shell uname -m)
GITREV := $(shell git describe --always --dirty=-dirty)
D := $(HOME)/Documents/_SYSADMIN/docker/sneak/$(APPNAME)
BRANCH := $(shell git branch --show-current)
RN := sneak/builder
export DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/$(APPNAME)-$(ARCH)
.PHONY: default save build
default: save
clean:
rm -v $(D)/*.tzst
build: deps/modcache.tar
docker build \
-t $(RN):$(GITREV) \
@ -28,7 +32,8 @@ $(D)/latest.tzst: $(D)/$(GITREV).tzst
rm -f $@
ln -s $(D)/$(GITREV).tzst $@
$D/$(GITREV).tzst:
$D/$(GITREV).tzst: build
docker image inspect $(RN):$(GITREV)
-mkdir -p "$(D)"
docker save $(RN):$(GITREV) | pv | zstdmt -19 > $@.tmp
mv $@.tmp $@