There was no immediate official reaction from Russia, which hotly denies claims that it has sent troops and equipment to separatist rebels in Ukraine's east and which opposes Ukraine joining NATO.
The move came amid strong political tensions over President Petro Poroshenko's efforts to get approval of a constitutional change that would devolve some powers to the regions, including the eastern regions held by the rebels.
Opponents say the change would effectively be capitulation to Russia.
It was unclear if the military doctrine's stance against Russia could dilute opposition to the decentralization.
The doctrine now goes to Poroshenko for his signature.
At the security council meeting, Poroshenko said the doctrine "not only officially establishes the Russian Federation as Ukraine's military opponent, but states the task of relocating military units and creating the necessary military infrastructure in the eastern and southern regions."
On Monday, as the Ukrainian parliament gave initial approval to the decentralization measure, a violent protest broke out and three national guardsmen were killed when a grenade was thrown into the crowd.
Two parties in the governing coalition said Wednesday that they won't abandon the grouping amid the intense dispute over the proposal.
But those parties' opposition to the measure appears firm and Poroshenko faces a steep battle to push it through.
The initial approval given Monday was well short of the two-thirds majority needed to amend the constitution.
Oleh Berezyuk, head of the Samopomich faction, said Wednesday it will "remain in the coalition in the role of opposition within the parliamentary majority."
A member of Poroshenko's faction, Ihor Kononeko, said the faction of former Prime Minister Yulia Tymoshenko would also remain in the coalition, the Interfax news agency reported.