Doctrine comes from the same place as Scripture... the Church.
Scriptures didn’t come from a particular earthly church, but “holy men of God spake as they were moved by the Holy Ghost.” (2 Peter 1:21)
Individual holy men were selected by the Holy Ghost.