static: Use bin/share/doc layout in archives#460
Conversation
|
I'm a bit hesitant on having no directory at all; specifically if the archive contains multiple; it makes it really easy to accidentally unzip/untar and end up with the content sprayed across your current directory.
It's not strictly needed; currently you can opt-in to skipping the directory, e.g. with Not sure what the exact equivalent is for Zip; looks like One thing we CAN consider (but mainly for Linux / macOS) is to use the same approach as containerd; tar -tzf containerd-2.3.2-linux-amd64.tar.gz
bin/
bin/containerd
bin/containerd-shim-runc-v2
bin/ctr
bin/containerd-stress
tar -tzf docker-29.6.1.tgz
docker/
docker/containerd
docker/dockerd
docker/docker-init
docker/runc
docker/docker-proxy
docker/docker
docker/ctr
docker/containerd-shim-runc-v2Using tar -C /usr/local -xzf containerd-2.3.2-linux-amd64.tar.gz
tree /usr/local/
/usr/local/
├── bin
│ ├── containerd
│ ├── containerd-shim-runc-v2
│ ├── containerd-stress
│ └── ctr
├── lib
└── share
3 directories, 4 filesThat would also allow bundling other things ( |
|
Ah, the bin/lib makes sense indeed. How about LICENSE files? |
Yeah, I think that would be something like;
Basically, I think those paths would be the same as we use for our |
Restructure the static archive staging directories to follow the FHS-style bin/share/doc hierarchy. - bin/<binary> - share/doc/<pkgname>/LICENSE - share/doc/<pkgname>/README.md This allows users to extract directly into a prefix directory with no extra steps: tar -C /usr/local -xzf docker-buildx-linux-amd64.tgz Previously, archives contained a single top-level named subdirectory (e.g. docker-buildx/), so users had to either cd into it after extraction or use --strip-components=1. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM
once we completed these changes, we should probably also look at updating instructions; one thing we didn't consider / document so far is the alternative to use /opt; https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html
Basically, would use the same structure, but prefixed by the package name, e.g.;
/opt/docker-29.6.1/
├── bin/
├── share/
│ ├── doc/
│ │ └── docker/
│ └── man/
└── ...
Users can then add that to their PATH (or symlink) to update a version
Restructure the static archive staging directories to follow the
FHS-style bin/share/doc hierarchy.
This allows users to extract directly into a prefix directory with no
extra steps:
tar -C /usr/local -xzf docker-buildx-linux-amd64.tgz
Previously, archives contained a single top-level named subdirectory
(e.g. docker-buildx/), so users had to either cd into it after
extraction or use --strip-components=1.