Police shot and wounded a man armed with a knife after he attacked officers inside a police barracks in eastern France on Monday.