5 ms·
I wrote undocker[1], which converts a docker "container" to a rootfs tarball. I really wish docker container format were documented as well as squashfs here. Su
by motiejus 4y ago
I wrote undocker[1], which converts a docker "container" to a rootfs tarball. I really wish docker container format were documented as well as squashfs here. Surprising, given Docker Inc should have had enough resources to make their most important format well documented. :)
Anyway, undocker requires extracting the archive before using it. Squashfs wouldn't. Perhaps I will write a docker2squash, so we can mount and run these images immediately after download.
[1]: https://git.sr.ht/~motiejus/undocker https://git.sr.ht/~motiejus/undocker
- st_goliath 4y ago> Perhaps I will write a docker2squash, so we can mount and run these images immediately after download. Well, if you already have a rootfs tarball, I guess the bulk of the work is done. The tarball can be directly piped into tar2sqfs[1] or sqfstar[2]. [1] https://manpages.debian.org/unstable/squashfs-tools-ng/tar2sqfs.1.en.html https://manpages.debian.org/unstable/squashfs-tools-ng/tar2s... [2] https://manpages.debian.org/testing/squashfs-tools/sqfstar.1.en.html https://manpages.debian.org/testing/squashfs-tools/sqfstar.1...
- motiejus 4y agoNice, thanks! I won't. :)
- chriswarbo 4y ago> I wrote undocker[1], which converts a docker "container" to a rootfs tarball I thought a "container" (or, more precisely, a "container image"; or even more precisely, a "container image layer") is a tarball? I've been creating multi-layer container images using `tar` (plus `sha256sum` and `jq` for the corresponding JSON "manifests"), and it works fine e.g. on AWS ECS.
- guipsp 4y agoCan you detail further? - Personally, this seems like insanity so I'm curious what lead you down this path instead of using the more common tools like docker compose or buildah.
- chriswarbo 4y ago> instead of using the more common tools like docker compose or buildah How are those tools "more common" than GNU tar? > I'm curious what lead you down this path I had an executable; I wanted to run it on ECS; so I ran the `tar` command. Pretty simple really :)
- motiejus 4y agoA tarball of tarballs, layered using barely documented rules (e.g. you can add a directory, remove it on upper layer, and re-add something else on top). Constructing them is easier than unpacking. :)
- chriswarbo 4y agoAh, so you're re-creating the results of overlay-mounting the layers? I'm definitely ignorant of the exact rules for those; I only use them to split up large images into a "mostly static" layer (e.g. dependencies, which may be large) and a "subject to change" layer (i.e. our code, which will be different for each version)