FYI: Restoring an APFS Container from a disk image
Having created a disk image of an APFS Container on an external drive using the Disk Utility (Image from "Container disk", encrypted and stored with the "compressed" option (the readonly option should also work)), I could not initially retrieve the contents by using the Disk Utility.
Here are the steps that I used to restore the APFS volumes. Take note that the target drive is completely erased.
1) Generate a checksum (equivalent to "Scan for restore" using the Disk Utility):
2) Restore the APFS Container:
Below is a screenshot of the Disk Utility showing that the APFS volume group has been properly restored:
The DMG file used as input was quite large (141GB):
Here is a screenshot of the DMG contents (when mounted):
Hope this helps anyone else who comes across this issue.
- Pie Lover