Skip to content

devops(docker): split browser layers and use zstd compression for faster pulls#40702

Open
KRRT7 wants to merge 4 commits intomicrosoft:mainfrom
KRRT7:docker-optimize-pull-time
Open

devops(docker): split browser layers and use zstd compression for faster pulls#40702
KRRT7 wants to merge 4 commits intomicrosoft:mainfrom
KRRT7:docker-optimize-pull-time

Conversation

@KRRT7
Copy link
Copy Markdown

@KRRT7 KRRT7 commented May 7, 2026

Summary

  • Split the single browser-install RUN into per-browser layers (chromium, firefox, webkit, ffmpeg) enabling Docker's parallel layer downloading
  • Switch publish pipeline from docker build + docker push to docker buildx build --push with zstd compression (level 19) for ~25% smaller compressed layers
  • Refactor tagging to build once per arch and create additional tags via docker buildx imagetools create (registry-side copy, no layer re-upload)
  • Add docker/setup-buildx-action to CI (required for buildx + zstd output)

Note on zstd compatibility

zstd-compressed layers require Docker 23.0+ (Feb 2023) on the client side. Older Docker versions will fail to pull. If this is a concern for your user base, the layer-splitting alone still provides a significant speedup via parallel downloads, and the zstd change could be dropped or deferred.

Fixes #40701

KRRT7 added 4 commits May 7, 2026 07:41
The zstd compression output requires a buildx builder with the
docker-container driver. Also removes the now-unused tag_and_push
function.
Build pushes one canonical tag per arch, then tag_and_push creates
additional tags via `docker buildx imagetools create` (registry-side
copy, no layer re-upload).
Use `install-deps` for all system dependencies in one shared layer,
then `install` (without --with-deps) per browser for binary-only
layers. This eliminates duplicate apt index fetches and makes browser
layers pure binary data with better zstd compression ratio.
@pavelfeldman
Copy link
Copy Markdown
Member

Thanks for looking into it. I'm sure we have customers with older docker clients. But I'm ok with the layering change. Could you provide the numbers? Time w/ and w/o layers next to each other.

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.

[Feature]: Reduce Docker image size to improve container pull time

2 participants