static: Flatten archive structure#460
Conversation
Previously the tgz/zip archives contained a named subdirectory (e.g. containerd.io/, docker-buildx/, docker-compose/), requiring users to cd into it after extraction. Change the tar and zip commands to archive from inside the staging directory so all files (binaries, LICENSE, README.md) land directly at the archive root. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
|
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 |
Previously the tgz/zip archives contained a named subdirectory (e.g. containerd.io/, docker-buildx/, docker-compose/), requiring users to cd into it after extraction.
Change the tar and zip commands to archive from inside the staging directory so all files (binaries, LICENSE, README.md) land directly at the archive root.