The term comes from the early 17th-century Dutch phrase doe den tap toe (Dutch for "turn off the tap"), a signal sounded by drummers or trumpeters to instruct innkeepers near military garrisons to stop serving beer and for soldiers to return to their barracks and is unrelated to the ink tattoo that was borrowed from Tahitian.
The term dates from around 1600 during the Thirty Years' War in the Low Countries (Belgium and the Netherlands).
Drummers from the garrison were sent out into the towns at 21:30 hrs (9:30 pm) each evening to inform the soldiers that it was time to return to barracks and the innkeepers that no more beer was to be served, that the taps were to be closed.
Tattoo, earlier spelled tap-too then taptoo, are alterations of the Dutch words tap toe, which have the same meaning.
Tattoos were commonplace in the late 19th century, with most military and garrison towns putting on some kind of show or entertainment during the summer months.