moby / moby/buildkit

Add "unsquash" exporter option (or Dockerfile instruction) for deduping files in a layer

Open
#4,236 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

An exporter option unsquash=/foo will unsquash /foo/* into new layers for sake of dedupe.

e.g.,

Layer0: /bin, /lib, /usr, ...
Layer1: /foo/a, /foo/b, /foo/c, /bar/x, /bar/y, /bar/z, ...

Layer0: /bin, /lib, /usr, ...
Layer1: /bar/x, /bar/y, /bar/z, ...
Layer2: /foo/a
Layer3: /foo/b
Layer4: /foo/c

Maybe this can be also implementable as a Dockerfile instruction like UNSQUASH /foo.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating BuildKit's exporter-option handling and Dockerfile instruction parsing, then determine which path can support the proposed layer transformation. Done means one supported interface implements the stated unsquash behavior with coverage for the example layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile, go
Domain
build-system, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.