How to remove a container disk and reclaim space with boot partision? I want to delete Apple_APFS container disk1 and reclaim the space to disk2.
I boot on disk2 (Macintosh HD).
This is a duplicate question, however I will still post this answer.
The steps are not obvious.

Use the diskutil command to convert the disk1 APFS container to an empty JHFS+ formatted partition.
sudo diskutil apfs deletecontainer disk0s3


Remove the JHFS+ formatted partition disk0s3. The free space will not belong to any partition.
sudo diskutil erasevolume free none disk0s3


Expand the disk2 container to reclaim the just created free space. The value of 0 means to reclaim as much free space as exists directly after the disk0s2 APFS container partition.
sudo diskutil apfs resizecontainer disk0s2 0