box-builder / tarutil

provides helpers to handle tar archives
Apache License 2.0
1 stars 1 forks source link

chrootarchive support #18

Open erikh opened 7 years ago

erikh commented 7 years ago

This should be done as follows:

  1. Implement runc support, we can rely on runc in the path for this.
  2. runc will run a compiled program we embed into tarutil for the sole purpose of unpacking a file with a specialized filename.
  3. The filename and tar program are stored at the root of the rootfs.
  4. The runc command is invoked with the appropriate container flags for unpacking. It's important to not unpack over the tar file for hopefully obvious security reasons.
  5. The files are overwritten (whiteout) in the unlucky event the inodes are the same file, they won't refer to our tar program or tar file (it'll just be nulled).
  6. Stop runc and return the tar path.