latest with caching
This commit is contained in:
parent
587f9420ea
commit
d9f468f825
|
@ -1,6 +1,2 @@
|
|||
*.tzst
|
||||
/buildimage
|
||||
/dockerdeps
|
||||
/tmp
|
||||
*.docker.tzst
|
||||
*.tmp
|
||||
*.dockerimage
|
||||
|
|
|
@ -2,7 +2,5 @@ mfer/*.pb.go
|
|||
/mfer.cmd
|
||||
/tmp
|
||||
*.tmp
|
||||
*.docker.tzst
|
||||
*.tzst
|
||||
/builddeps/modcache.tar
|
||||
*.dockerimage
|
||||
/vendor
|
||||
|
|
18
Dockerfile
18
Dockerfile
|
@ -1,23 +1,29 @@
|
|||
################################################################################
|
||||
#2345678911234567892123456789312345678941234567895123456789612345678971234567898
|
||||
################################################################################
|
||||
FROM sneak/builder:14e59af AS builder
|
||||
FROM sneak/builder:2022-12-08 AS builder
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
WORKDIR /build
|
||||
COPY ./Makefile ./.golangci.yml ./go.mod ./go.sum .
|
||||
COPY ./vendor.tar /build/vendor.tar
|
||||
COPY ./Makefile ./.golangci.yml ./go.mod ./go.sum /build/
|
||||
COPY ./vendor.tzst /build/vendor.tzst
|
||||
COPY ./modcache.tzst /build/modcache.tzst
|
||||
COPY ./internal ./internal
|
||||
COPY ./bin/gitrev.sh ./bin/gitrev.sh
|
||||
COPY ./mfer ./mfer
|
||||
COPY ./cmd ./cmd
|
||||
RUN find /build
|
||||
ARG GITREV unknown
|
||||
|
||||
RUN mkdir -p "$(go env GOMODCACHE)" && cd "$(go env GOMODCACHE)" && \
|
||||
zstdmt -d --stdout /build/modcache.tzst | tar xf - && \
|
||||
rm /build/modcache.tzst && cd /build
|
||||
RUN \
|
||||
cd mfer && go generate . && cd .. && \
|
||||
GOPACKAGESDEBUG=true golangci-lint run ./... && \
|
||||
tar xf vendor.tar && rm vendor.tar && \
|
||||
mkdir vendor && cd vendor && \
|
||||
zstdmt -d --stdout /build/vendor.tzst | tar xf - && rm /build/vendor.tzst && \
|
||||
cd .. && \
|
||||
make mfer.cmd
|
||||
RUN go mod vendor && tar -c . | zstdmt -19 > /src.tzst
|
||||
RUN rm -rf /build/vendor && go mod vendor && tar -c . | zstdmt -19 > /src.tzst
|
||||
################################################################################
|
||||
#2345678911234567892123456789312345678941234567895123456789612345678971234567898
|
||||
################################################################################
|
||||
|
|
17
Makefile
17
Makefile
|
@ -56,9 +56,9 @@ lint:
|
|||
golangci-lint run
|
||||
sh -c 'test -z "$$(gofmt -l .)"'
|
||||
|
||||
docker: sneak-mfer.$(ARCH).docker.tzst
|
||||
docker: sneak-mfer.$(ARCH).tzst.dockerimage
|
||||
|
||||
sneak-mfer.$(ARCH).docker.tzst: $(SOURCEFILES) vendor.tar
|
||||
sneak-mfer.$(ARCH).tzst.dockerimage: $(SOURCEFILES) vendor.tzst modcache.tzst
|
||||
docker build --progress plain --build-arg GITREV=$(GITREV_BUILD) -t sneak/mfer .
|
||||
docker save sneak/mfer | pv | zstdmt -19 > $@
|
||||
du -sh $@
|
||||
|
@ -67,7 +67,16 @@ godoc:
|
|||
open http://127.0.0.1:6060
|
||||
godoc -http=:6060
|
||||
|
||||
vendor.tar: go.mod go.sum
|
||||
vendor.tzst: go.mod go.sum
|
||||
go mod tidy
|
||||
go mod vendor
|
||||
tar -c vendor > $@
|
||||
cd vendor && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
|
||||
rm -rf vendor
|
||||
mv $@.tmp $@
|
||||
|
||||
modcache.tzst: go.mod go.sum
|
||||
go mod tidy
|
||||
cd $(HOME)/go/pkg && chmod -R u+rw . && rm -rf mod sumdb
|
||||
go mod download -x
|
||||
cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
|
||||
mv $@.tmp $@
|
||||
|
|
Binary file not shown.
BIN
vendor.tar
BIN
vendor.tar
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue