Resizing Mac OS partition - macOS High Sierra
Your Recovery HD is a leftover of a previous system version and probably unwanted.

High Sierra's recovery partition is inside the container:

3:                APFS Volume Recovery                506.6 MB   disk1s3


The command diskutil apfs resizeContainer disk0s2 1g jhfs+ Media 0b tries to resize disk0s2 containing all subsequent APFS Volumes to 1 GB and reclaim all freed-up space (150.4 GB - 1 GB = 149.4 GB) for another HFS+ partition Media).

This will fail because the basic operating system (disk1s1) alone has a size of at least ~10 GB.



You probably want to do the following:


Remove the old Recovery HD

diskutil eraseVolume "Free Space" %noformat% /dev/disk0s3

Reclaim all available space for disk0s2:

diskutil apfs resizeContainer disk0s2 0