From ef2f6012e171e55f5802f6d68ba9ca7ece03e600 Mon Sep 17 00:00:00 2001 From: apple Date: Sat, 14 Nov 2026 13:58:54 +0800 Subject: [PATCH] fix: keep go caches on disk instead of tmpfs /tmp On the target host /tmp is a tmpfs sized at half of RAM (~970M), so the go module cache and build cache together filled it and every module download failed with "no space left on device". Move both caches to /var/tmp, which lives on the root filesystem, and create both cache directories up front rather than only the build cache. --- common.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 48d4e02fd..69862ab02 100644 --- a/common.mk +++ b/common.mk @@ -2,8 +2,8 @@ GO_ARGS ?= GO_PLUGIN_MAKE_TARGET ?= build GO_REPO_ROOT := /go/src/github.com/dokku/dokku BUILD_IMAGE := hub.diyla.com/golang:1.27.3 -GO_BUILD_CACHE ?= /tmp/dokku-go-build-cache -GO_MOD_CACHE ?= /tmp/dokku-go-mod-mod +GO_BUILD_CACHE ?= /var/tmp/dokku-go-build-cache +GO_MOD_CACHE ?= /var/tmp/dokku-go-mod-mod GO_ROOT_MOUNT ?= $$PWD/../..:$(GO_REPO_ROOT) ifndef TARGETARCH TARGETARCH := $(shell dpkg --print-architecture 2>/dev/null || uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') @@ -15,7 +15,7 @@ GOARCH ?= $(TARGETARCH) build: $(BUILD) build-in-docker: clean - mkdir -p /tmp/dokku-go-build-cache + mkdir -p $(GO_BUILD_CACHE) $(GO_MOD_CACHE) docker run --rm \ -v $(GO_ROOT_MOUNT) \ -v $(GO_BUILD_CACHE):/root/.cache \