From 158fe49cfa4d8a522b05cbeabc8dc5a27fafbab1 Mon Sep 17 00:00:00 2001 From: Sami Alajrami Date: Wed, 19 Aug 2026 13:44:21 +0200 Subject: [PATCH] fix(docker): add writable /tmp to the scratch-based image Kosli's temp-dir usage (directory fingerprinting, evidence tarballing) relies on os.MkdirTemp, which fails when /tmp doesn't exist at all, as is the case in the scratch base image. Stage an empty dir in the builder stage and copy it into the final image as a world-writable /tmp. Co-Authored-By: Claude Sonnet 5 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index e5b0a0861..abac0de8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,12 @@ COPY . . RUN make build +RUN mkdir -p /image-tmp + ### Final Image ### FROM scratch COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /go/src/kosli/kosli /bin/kosli +COPY --from=builder --chmod=1777 /image-tmp /tmp ENTRYPOINT ["/bin/kosli"]