Here's another WWII military comedy that I enjoyed long ago. Check out the cast, and you can see that it would be a lot of fun. It's even based on true events (including the pink submarine and the toilet paper shortage). Grant is the sub's commander, and after it's seriously damaged in an air attack, Tony Curtis is assigned to it, though he's never been on a sub before. The sub struggles along toward Australia, trying to avoid the Japanese and picking up five army nurses along the way.
Curtis is a con man, not at all devoted to his military service, but he proves so adept at providing needed supplies and in making money when necessary that Grant's happy to have him around. As the movie goes along, Curtis begins to change his attitude, and the ending of this one is like the ending of Soldier in Rain in that respect.
Since this was made back in the late '50s, you can imagine that there are a lot of sexist jokes that might not play too well these days. They seemed amusing enough at the time, however. I haven't seen this one in years, but I have a feeling it would make me laugh if I saw it again.