Mac: resize APFS container

resize a disk container to increase the size

If you have a disk that was 50GB but want to increase it to 100GB run the following from the terminal to increase the container size.

diskutil list

You should see a list of your drives. Find the one marked:
Apple_APFS Container disk x

And look for the identifier, something like:
disk2s2

In my instance disk2s2 references disk 3.
So disk2 is physical and disk 3 is synthesized.

We now repair the physical disk, disk2:
diskutil repairdisk disk2

Ignore the EFI warning.

Finally run:
sudo diskutil apfs resizeContainer disk2s2 100g