brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: docker build --no-cache rebuilds every layer, builder prune clears the cache

Cache
~/tips/tip-cache-docker-build-no-cache-prune

docker builder prune --filter until=72h

Forces a full rebuild without stored layers and removes old build cache entries by age.

A build that keeps using an old layer is usually doing what the cache rules tell it to do.

docker build --no-cache --pull -t app:test .
docker builder prune --filter until=72h

--no-cache ignores all stored layers, and --pull fetches a fresh copy of the base image first. That is a heavy way to fix one stale step like apt-get install or a git clone. To refresh only from one point onward, put an ARG with a changing value in front of that line, for example --build-arg REFRESH=$(date +%s). docker builder prune --filter until=72h deletes build cache entries older than three days and asks for confirmation first.

Further reading: Docker docs: Build cache

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Cache tips fincore /var/lib/example/data.db npm cache verify fc-cache -f -v ~/.local/share/fonts proxy_cache app; Cache-Control: no-cache All Cache tips (24) All topics

Link