Skip to content

static: Simplify archive directory layout - #571

Merged
vvoland merged 2 commits into
docker:mainfrom
tianon-sso:static-simplify-layout
Nov 12, 2026
Merged

vvoland merged 2 commits into
docker:mainfrom
tianon-sso:static-simplify-layout

Conversation

@tianon-sso

Copy link
Copy Markdown
Member

#460 staged each archive as an FHS prefix tree. Consumers that only need part of an archive (the usual case when assembling an image) have to know that internal nesting and strip it again, and the layout means nothing for the Windows zips, where Docker looks in %ProgramFiles%\Docker\cli-plugins.

Use the directory names the docker CLI itself uses instead:

  • <pkgname>/bin/<binary>
  • <pkgname>/cli-plugins/<plugin> (buildx, compose, model, agent)
  • <pkgname>/doc/{LICENSE,README.md}

The top-level directory and the doc contents are unchanged (containerd still ships runc.* and runhcs.* alongside its own). Picking out one piece is now a single extraction, for example:

tar -C /usr/local/libexec/docker/cli-plugins --strip-components=2 \
  -xzf docker-buildx-plugin_<version>.tgz \
  docker-buildx-plugin/cli-plugins

Extracting an archive wholesale into /usr/local no longer installs plugins where the docker CLI looks, so the verify images now show the intended integration: bin to /usr/local/bin, cli-plugins to /usr/local/libexec/docker/cli-plugins, and doc to /usr/local/share/doc/<pkgname>.

Assisted-By: "claude my eyes right out"

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes LGTM (thanks!)

failures are unrelated, and working on a fix

@thaJeztah
thaJeztah force-pushed the static-simplify-layout branch from 826eb4d to 3ff82bc Compare November 11, 2026 09:25
@thaJeztah

Copy link
Copy Markdown
Member

(rebased after #573 was merged)

9c15c0c staged each archive as an FHS prefix tree. Consumers that only
need part of an archive (the usual case when assembling an image) have
to know that internal nesting and strip it again, and the layout means
nothing for the Windows zips, where Docker looks in
`%ProgramFiles%\Docker\cli-plugins`.

Use the directory names the docker CLI itself uses instead:

- `<pkgname>/bin/<binary>`
- `<pkgname>/cli-plugins/<plugin>` (buildx, compose, model, agent)
- `<pkgname>/doc/{LICENSE,README.md}`

The top-level directory and the doc contents are unchanged (containerd
still ships `runc.*` and `runhcs.*` alongside its own). Picking out one
piece is now a single extraction, for example:

    tar -C /usr/local/libexec/docker/cli-plugins --strip-components=2 \
      -xzf docker-buildx-plugin_<version>.tgz \
      docker-buildx-plugin/cli-plugins

Extracting an archive wholesale into `/usr/local` no longer installs
plugins where the docker CLI looks, so the verify images now show the
intended integration: bin to `/usr/local/bin`, cli-plugins to
`/usr/local/libexec/docker/cli-plugins`, and doc to
`/usr/local/share/doc/<pkgname>`.

Assisted-By: "claude my eyes right out"
Signed-off-by: Tianon Gravi <tianon.gravi@docker.com>
@thaJeztah
thaJeztah force-pushed the static-simplify-layout branch from 3ff82bc to 8793d65 Compare November 11, 2026 10:44
@thaJeztah

Copy link
Copy Markdown
Member

And rebased after #574 was merged with the other fix

Comment thread pkg/agent/verify.Dockerfile Outdated
Comment on lines +113 to +117
tar zxvf "${package##*/}" -C /usr/local --strip-components=1
pkgname="${package##*/}"
pkgname="${pkgname%%_*}"
mkdir -p /usr/local/libexec/docker/cli-plugins "/usr/local/share/doc/${pkgname}"
tar zxvf "${package##*/}" -C /usr/local/libexec/docker/cli-plugins --strip-components=2 "${pkgname}/cli-plugins"
tar zxvf "${package##*/}" -C "/usr/local/share/doc/${pkgname}" --strip-components=2 "${pkgname}/doc"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I recall we were discussing was to drop the <packagename> prefix, but keep the bin/ doc/ directories. ISTR that's the layout that (e.g.) containerd uses for its packages.

curl -fsSL https://github.com/containerd/containerd/releases/download/v2.4.2/containerd-2.4.2-linux-arm64.tar.gz | tar -tzf -
bin/
bin/containerd
bin/containerd-shim-runc-v2
bin/containerd-stress
bin/ctr

Doing so also means that we can keep --strip-components=1, but also preserve the slight organisation to separate docs or other content from binaries.

any thoughts @glours @crazy-max @vvoland ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally very +1 on removing the prefix, but I felt like I was already asking a lot with the restructure so I didn't want to rock the boat too hard if others feel strongly it should be there (it doesn't bother me as much / is more standard than share/doc/xxx/ in the archive paths) -- that being said, I'll joyfully update if others agree it can go! 😄

Assisted-By: "claude my eyes right out"
Signed-off-by: Tianon Gravi <tianon.gravi@docker.com>

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

I'll keep the final look for @vvoland, so not merging yet.

@vvoland
vvoland merged commit 732c958 into docker:main Nov 12, 2026
1485 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants