We should never attack anyone unless our lives, or physical well being depend on it. So we don’t break the 5th commandment.
The 5th Commandment does not apply to just punishments. This is why traditionally Catholics have virtually always accepted capital, as well as corporal, punishment. It has never been Church teaching that self-defence is the only acceptable reason to use force.
If one looks at the examination of conscience in the Angelus Missal, one of the questions under the 5th commandment is whether one has "threatened or struck others
not under your charge". Catholics believe that physical force may be used as a legitimate exercise of authority.
One may make an argument that a husband does not have that sort of authority over his wife (although this is not historically the Catholic view), but one cannot claim that self-defence is the only permissible reason for physical force.