The word
flunky has come into Standard English from Scots, in which the word meant "liveried manservant, footman," coming at least by the 19th century to be a term of contempt. The word is first recorded and defined in a work about Scots published in 1782. The definition states that a
flunky is "literally a sidesman or attendant at your flank," which gives support to the suggestion that
flunky is a derivative and alteration of
flanker, "one who stands at a person's flank."