Nelson Nelson punched two officers in the face after being refused travel at Nottingham railway station, following his threats to "knock them out".
The 28-year-old, who had previously admitted offences including two counts of actual bodily harm, assault with intent to resist arrest and assaulting an emergency worker, was jailed on Monday, Nottinghamshire Police said.
He was stopped by British Transport Police (BTP) on April 4, during lockdown.
Asked why he was travelling, Nelson, of Broadfield Walk, Birmingham, became violent, assaulting three officers in his bid to get away.
He knocked two officers to the ground during an initial scuffle, with one falling unconscious.
The other officer got up and gave chase before Nelson dragged him in front of an oncoming bus.
Nottinghamshire Police officers then arrived on the scene before Nelson charged at and punched another officer.
He then ran off, jumping over two fences close to Station Street where an officer and police dog Quantum were standing.
Nelson picked up a plank of wood with a nail in and charged them, repeatedly hitting the dog, and cutting its chin.
A flick-knife was recovered during the incident.
It is not the first time four-year-old Quantum, a Belgian malinois-German shepherd cross, had been injured in the line of duty.
In March 2018 he needed stitches after being stabbed.
Nelson admitted the assaults as well as possessing an offensive weapon, having a knife and causing unnecessary suffering to Quantum, at Nottingham Magistrates' Court on April 6.
Magistrates deemed they had insufficient sentencing powers and sent the case to a higher court.
He was jailed at Nottingham Crown Court on Monday.
After sentencing, Nottinghamshire Chief Constable Craig Guildford said the jail term would send a "very clear message" to those who break the law, especially during lockdown.
He said: "This is a particularly nasty case where officers who are working hard to engage with the public to ensure that 'stay at home' guidance is being followed have been subjected to a vicious and sustained assault.
"The officers acted swiftly, bravely and decisively in assisting their British Transport Police colleagues and I'm convinced PD Quantum prevented further serious injury to them or the public.
"Our officers, staff and volunteers will not hesitate to jump to the defence of their fellow key workers who are working so hard to lead the nation's response to the coronavirus outbreak, and this case is further evidence of that."
Chief Inspector Gareth Davies, from BTP, described it as a "truly horrifying incident" involving officers who were just trying to do their jobs.
"There is never an excuse for this sort of behaviour, but it's all the more shocking to think this violent rampage began after Nelson was simply asked if his journey was essential," he said.
"Thankfully, no one was more seriously injured, and Nelson will now have the next few years to reflect on his actions in prison."