Skip to content

static: Flatten archive structure#460

Open
vvoland wants to merge 1 commit into
docker:mainfrom
vvoland:static-flatten
Open

static: Flatten archive structure#460
vvoland wants to merge 1 commit into
docker:mainfrom
vvoland:static-flatten

Conversation

@vvoland

@vvoland vvoland commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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.

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>
@thaJeztah

Copy link
Copy Markdown
Member

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.

requiring users to cd into it after extraction.

It's not strictly needed; currently you can opt-in to skipping the directory, e.g. with --strip-components=1 (which would extract everything skipping the directory).

Not sure what the exact equivalent is for Zip; looks like unzip -j archive.zip would skip all directory structure.

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-v2

Using bin/ (and similar paths) allows extracting the content directly to a prefix path;

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 files

That would also allow bundling other things (/usr/local/lib, ...)

@vvoland

vvoland commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Ah, the bin/lib makes sense indeed. How about LICENSE files?

@thaJeztah

Copy link
Copy Markdown
Member

Ah, the bin/lib makes sense indeed. How about LICENSE files?

Yeah, I think that would be something like;

  • documentation / licenses: /usr/local/share/doc/<package name>/LICENSE (and NOTICE and README.md or what else)
  • man-pages; /usr/local/share/man/

Basically, I think those paths would be the same as we use for our deb and rpm

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.

2 participants