The Private Navy of Sgt. O'Farrell (1968)
The Private Navy of Sgt. O'Farrell is a 1968 film directed by Frank Tashlin and starring Bob Hope, Phyllis Diller, and Jeffrey Hunter. The movie was filmed in Puerto Rico in 1967; it was originally to have been filmed in Hawaii, but due to the activity during the Vietnam War, the US Department of Defense who cooperated with the production, suggested the film move to the Caribbean.
More at Wikipedia.