The High Court in Glasgow heard that seconds before the stabbings 39-year-old Hugh McPhee was seen to calmly put on the vest, which was similar to ones worn by police officers.
Judge Lady Stacey ordered McPhee should also be monitored in the community for three years after his release from prison.
The court heard McPhee was "growling" at a customer in the Drum in Shettleston Road, Glasgow, on July 3.
He then repeatedly stabbed 57-year-old Isaac Armstrong before attempting to knife Daniel Ferguson, 34.
McPhee, from Shettleston, also stabbed Samuel Freeman, 55, who with the help of another man wrestled the knife from his attacker's grip.