From 4a2806f6d14fea3b3055d48815449a095cbd951d Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Thu, 27 Oct 2022 00:47:12 +0200 Subject: [PATCH] build: fix deb-docker performance on newer Docker See comment in Makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 8264ce9..4bb01a2 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,13 @@ endif deb-docker: docker build -t zrepl_debian_pkg --pull -f packaging/deb/Dockerfile . + # Use a small open file limit to make fakeroot work. If we don't + # specify it, docker daemon will use its file limit. I don't know + # what changed (Docker, its systemd service, its Go version). But I + # observed fakeroot iterating close(i) up to i > 1000000, which costs + # a good amount of CPU time and makes the build slow. docker run --rm -i -v $(CURDIR):/build/src -u $$(id -u):$$(id -g) \ + --ulimit nofile=1024:1024 \ zrepl_debian_pkg \ make deb GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM)