JA is right, it's really a common phase during which kids have no effective way to express frustration, annoyance, or urgent desire. They make sense of it eventually if parents don't respond in kind (with frustration, annoyance, or an urgent desire to have the behavior stop), but rather model the behavior they want to see, and give the child words to use instead of action. And it helps to become familiar enough with the situations in which the behavior arises to avoid them in the first place when possible.
Calm repetition, firmly holding the child's hands and/or removing him from the situation, repeating a composed and consistent phrase or two about not hurting people – these do work, often within a few weeks. Children learn most thoroughly the behaviors and expressions they see modeled by their parents.
So I hope you'll think of "discipline" in its most accurate definition of guidance and teaching, rather than punishment.
You'll probably be advised by some to bite or pinch back. This can shock or frighten some children into stopping the behavior. But I worry that that creates a logical problem: why do big people get to do what they are telling little people to stop doing? You can see where a young mind might go with that.
And it keeps the solution externalized: I won't bite because we might get hurt and punished, not because I learn the Golden Rule. I've met an awful lot of adults who behave only when they think they'll get caught. I can't help but wonder how many of them did not receive guidance that allowed them to logically internalize an ethical code. Social researchers argue that there is a measurable connection.
My grandson had a few biting incidents at his preschool at that age, but the teachers were experienced and shadowed him, and swooped to the rescue as soon as he started to get agitated. And of course, his parents gave him frequent coaching at home, including role-playing potential incidents with puppets or stuffed animals.