From b53e20f8cf7fc3c419978ca417d81f4a64c28647 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Fri, 18 Sep 2026 10:45:58 +0200 Subject: build: declare VERSION after the apt layers so the cache survives --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 41e2895..b55f44d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ # syntax=docker/dockerfile:1 FROM debian:bookworm-slim AS build -ARG VERSION=0.1.0-dev +# VERSION is declared after the expensive layers: the legacy builder +# invalidates every layer that follows a changed build argument. RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential libncurses-dev \ libssl-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /src COPY . . +ARG VERSION=0.1.0-dev # With .prebuilt/ the binaries are cross-compiled on the development machine # (see deploy/Dockerfile.cross); otherwise build and test from source. RUN if [ -x .prebuilt/bokfd ]; then \ -- cgit v1.3