The president defended his alliance-based foreign policy as the world prepares for another round of America First.