Skip to content

Add image squashing via multi-stage build#65

Merged
apaolillo merged 1 commit intomainfrom
squash
Feb 3, 2026
Merged

Add image squashing via multi-stage build#65
apaolillo merged 1 commit intomainfrom
squash

Conversation

@apaolillo
Copy link
Owner

Introduce optional image squashing support in DockerBuilder. When enabled, the generated Dockerfile uses a multi-stage build where the final stage starts FROM scratch and copies the full filesystem from the build stage, eliminating layer bloat from intermediate steps.

The implementation preserves ARG, ENV, WORKDIR, USER, CMD, and ENTRYPOINT metadata in the final image, with a safe default CMD when none is specified.

Introduce optional image squashing support in DockerBuilder. When
enabled, the generated Dockerfile uses a multi-stage build where the
final stage starts FROM scratch and copies the full filesystem from the
build stage, eliminating layer bloat from intermediate steps.

The implementation preserves ARG, ENV, WORKDIR, USER, CMD, and
ENTRYPOINT metadata in the final image, with a safe default CMD when
none is specified.

Signed-off-by: Antonio Paolillo <apaolill@gmail.com>
@apaolillo apaolillo requested a review from adiscepo February 3, 2026 08:54
@apaolillo apaolillo self-assigned this Feb 3, 2026
@apaolillo apaolillo merged commit e0062eb into main Feb 3, 2026
5 checks passed
@apaolillo apaolillo deleted the squash branch February 3, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants