A fire that broke out aboard a container ship docked at the Port of Los Angeles was nearly contained by Saturday afternoon.