The Captain's Paradise (1953)
The Captain's Paradise is a 1953 British comedy film starring Alec Guinness and directed by Anthony Kimmins. It is set in Gibraltar, Morocco and on Captain Henry St. James (Alec Guinness)'s, passenger ship as it ferries to and fro between Gibraltar and a port in North Africa. The film begins at just before the end of the story, which is then told in a series of flashbacks.
More at Wikipedia.