mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
The runner-base stage COPY'd the standalone build as root and then ran `RUN chown -R node:node /app`. On overlayfs a chown rewrites every file it touches into the new layer, so the published image carried the ~2 GB standalone tree twice (docker history of diegosouzapw/omniroute:latest: `COPY /app/.build/next/standalone ./` 2.03 GB followed by `RUN chown -R node:node /app` 2.04 GB). Set `--chown=node:node` on the three COPYs that populate /app, drop the recursive chown, and hand /app and /app/data to node non-recursively next to the `mkdir -p /app/data` so the data dir stays writable without a volume. Measured by rebuilding the runner-base COPY/chown sequence against the published /app tree (root-owned source, same base image, linux/arm64): before: 4.38 GB of layers (COPY 2.04 GB + chown -R 2.04 GB), inspect Size 1220846106 after: 2.34 GB of layers (COPY --chown 2.04 GB), inspect Size 655117142 The fixed image runs as uid 1000, /app and /app/data are node-owned and writable, the server boots and healthcheck.mjs exits 0. hadolint output is unchanged. tests/unit/dockerfile-copy-chown-13990.test.ts guards the mechanism. Fixes #13990 Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
21 KiB
21 KiB