Repository navigation
static: Simplify archive directory layout - #571
Conversation
thaJeztah
left a comment
There was a problem hiding this comment.
changes LGTM (thanks!)
failures are unrelated, and working on a fix
826eb4d to
3ff82bc
Compare
|
(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>
3ff82bc to
8793d65
Compare
|
And rebased after #574 was merged with the other fix |
| 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" |
There was a problem hiding this comment.
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/ctrDoing 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 ?
There was a problem hiding this comment.
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>
#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.*andrunhcs.*alongside its own). Picking out one piece is now a single extraction, for example:Extracting an archive wholesale into
/usr/localno 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"