If you mean 'discipline' as 'punishment' then I don't think that he'll ever be old enough! I don't agree with punishment or rewards for children, having read so much about them.
However, he's definitely not too young do know you're cross with him and to have you consistently saying 'we don't throw our food' and (although he won't understand it yet) 'if you throw your food, I will have to take it away'. Don't say 'no' all the time, as it quickly becomes meaningless.
You need to a) accept that he's normal, b) accept that he won't learn things immediatedly and c) understand that he needs to learn things from being shown and having patient, loving explanations.
Food: I would keep asking him not to do it, keep cleaning it up, and keep taking it away for a minute to show him what you mean.
Cupboards: This is totally normal and healthy exploration. Don't lock him out of cupboards and rooms, but arrange your cupboards so that he has one cupboard with all your plastic things in that he is allowed to explore. So that, rather than saying 'don't do that' all the time, you're saying 'here, take the things out of this cupboard only please'. He'll learn with time - and make sure that the things in the other cupboards aren't extremely dangerous or seriously difficult to clean up!
The only locked cupboard in our house is the cleaning cupboard, and my DDs have been happy so long as they've had at least one cupboard to empty. Don't lock him out of the kitchen either - he won't ever learn any sort of safety in the kitchen if he's never allowed in there, and you might leave it open once by mistake, and he'll get in there knowing nothing about how to stay safe.
Provide lots of other interesting things for him to empty - a box of empty cardboard boxes (cereal boxes etc); a 'treasure basket'; a box full of fabric scraps.
Smacking: Just keep gently holding his hand/arm when he does this and say firmly 'be gentle with mummy please'. he will learn - he's just experimenting.
And definitely no 'time out'. That just says 'I only love you when you're nice' even if you don't mean that at all, which just makes children act up more, to test your love for them.