Dockerfile archives support zstd build contexts and ADD
Introduced 2026-09-02 · score 0.97
HOW TO USE IT
When building with Dockerfile syntax 1.27.0, a zstd-compressed archive can be the build context or an `ADD` source. Use the archive as the context, or add its files with `ADD <archive> <destination>`; local tar archives unpack by default.
# syntax=docker.io/docker/dockerfile-upstream:1.27.0
FROM alpine
ADD <archive.tar.zst> /destination/docker build -f <Dockerfile> <context.tar.zst>WHY THIS HELPS
Build an image from a zstd-compressed archive or add files from one with Dockerfile instructions.
REQUIREMENTS AND LIMITATIONS
- Version: dockerfile/1.27.0
- <archive.tar.zst> (required): The local archive source; recognized compression is determined from file contents, not its filename.
- <destination> (required): Image path where `ADD` extracts the archive contents.
- --unpack=<bool>: Controls automatic archive extraction. Local tar archives unpack by default; no mutually exclusive object subkeys apply.
- Dockerfile syntax version (required): Use `docker/dockerfile-upstream:1.27.0` to select the release's Dockerfile frontend.
- Prerequisite: Use Dockerfile syntax `docker/dockerfile-upstream:1.27.0` or a frontend that supports the change.
FIRST-PARTY EVIDENCE
- https://github.com/moby/buildkit/releases/tag/dockerfile/1.27.0
- https://github.com/moby/buildkit/blob/dockerfile/1.27.0/frontend/dockerfile/docs/reference.md
Check the installed version and the source before using it. Entry JSON