The classic 1980s Atari space game you are thinking of, where you clear stages and then dock your ship onto the next one, was called Starcastle. It was a well-remembered title from that era, known for exactly that stage-clearing and docking mechanic.