nbdkit is the pluggable Network Block Device server that Eric and I wrote. I have submitted a talk to FOSDEM next February about the many weird and wonderful ways you can use nbdkit as a flexible replacement for loopback mounting.
Anyway, new in nbdkit 1.7.6 you can now create ISO 9660 (CD-ROM) disk images on the fly from a directory:
# nbdkit iso /boot params="-JrT" # nbd-client -b 512 localhost /dev/nbd0 # file -bsL /dev/nbd0 ISO 9660 CD-ROM filesystem data 'CDROM' # mount /dev/nbd0 /tmp/mnt # ls /tmp/mnt config-4.18.0-0.rc8.git2.1.fc29.x86_64 config-4.19.0-0.rc1.git3.2.fc30.x86_64 config-4.19.0-0.rc6.git0.1.fc30.x86_64 efi extlinux grub2 [etc] # umount /tmp/mnt # nbd-client -d /dev/nbd0 # killall nbdkit
That ISO wouldn’t actually be bootable, but you could create one (eg. an El Torito ISO) by adding the appropriate extra parameters.
To head off the first question: If you copy files into the directory while nbdkit is running, do they appear in the ISO? Answer: No! This is largely impossible with the way Linux block devices work.