Bootc and the pitfalls of incomplete tar archives
bootc-dev.github.io·12h·
Discuss: Hacker News
🦀Rust
Preview
Report Post

As Colin Walters likes to say, containers are just tarballs wrapped in JSON. We’ll mostly ignore the JSON part here, but there’s a lot to unpack (pun and foreshadowing intended) with regards to tar and how it interacts with the various pieces that work in conjunction to make containers a reality.

A refresher on tar

Let’s explore a key quirk of tar from which everything else we’ll discuss follows.

First, let’s create a basic tar archive, which contains a directory with a file inside of the directory:

⬢ [jeckersb@toolbx tmp]$ mkdir foo
⬢ [jeckersb@toolbx tmp]$ touch foo/bar
⬢ [jeckersb@toolbx tmp]$ tar cf foo.tar foo/

Now let’s list the contents of the tar archive:

⬢ [jeckersb@toolbx tmp]$ tar tvf foo.tar
drwxr-xr-x jeckersb/jeckersb...

Similar Posts

Loading similar posts...