2 TIM 3:16 All Scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness,
Let’s analyse the key Greek words used in this verse, starting with the word (doctrine) from your query. However the other ‘key’ words will help clarify the understanding of ‘doctrine’ - as you also asked about’context’.
According to Strong’s Concordance, the Greek word “DIDASKALIA,” from which the English word “doctrine” was translated, means “instruction (the function or the information).” The word “doctrine” implies systematic or organized information or beliefs. God’s Word has to be the foundation of all our belief systems; therefore, it is the basis of all our refuting of error.
Reproof” was translated from the Greek word “ELEGCHOS,” and this Greek word means “conviction” (Strong’s Concordance). The root meaning of this word means “to confute, admonish” (Strong’s Concordance). The New International Version translated this as “rebuking.” God’s Word is profitable for rebuking sin and error.
“Correction” was translated from the Greek word “EPANORTHOSIS,” and this Greek word means “restoration to an upright or a right state...improvement...of life and character” (Thayer’s Greek-English Lexicon). Correction might involve reproof, but correction goes a step further. It not only exposes the wrong, which is a rebuke, but it also brings the individual receiving the correction to a better state, which a rebuke will not always do.
As mentioned in Romans 10:3, there are two types of righteousness. The Word of God is profitable for instructing us in both types. It will teach us about our right position in Christ, which is a product of our faith in Him, and it will teach us how to relate to our fellow man with right actions.