optimize conversion to squashfs when exporting through docker

related: #348 (closed) squashfs becomes supported and preferred image distribution method

Exporting container images through Charliecloud produces a compressed tar file. The squashfs workflow piggy backs off most of the existing scripts to convert from tar to squashfs, but this has some overhead.

example: ch-docker2tar ch-tar2sqfs

to produce a squashfs via ch-docker2sqfs

  • export to tar
  • compress tar
  • extract and uncompress tar
  • compress directory to squashfs

There are two ways I thought of to avoid the extra compression step for exporting from docker.

  1. add an optional flag to not compress when exporting to tar to existing scripts
  2. don't use the existing scripts, copy code from them and modify to skip compression

This would make the new workflow for squashfs:

  • export to uncompressed tar
  • extract tar
  • compress directory to squashfs

Using option 1 the squashfs scripts would call the tar scripts with the optional no compression flag.

ch-docker2tar -nocompress IMAGE OUTDIR ch-tar2sqfs

Option 2 would just put all the work that ch-docker2tar performs in the ch-docker2sqfs script, and avoid calling ch-docker2tar in ch-docker2sqfs.