In a well known account in the life of Christ, a man asked Jesus Christ a question about the New Covenant. Specifically, He asked Jesus what He had to do in order to receive eternal life. This was a New Covenant question because eternal life was never offered under the Old Covenant but is offered under the New Covenant.
The Old Covenant was a covenant between God and the physical nation of Israel and was made during the days of Moses. Israel agreed to obey God including God's law of the ten commandments, and in return God promised to bless Israel with national blessings of wealth, protection from enemies, and health (Exodus 15:25-26, 19:1-9, 20:1-17, 23:25-27, 24:3-8, Leviticus 26:3-13, Deuteronomy 28:1-14). But if you read carefully everything God promised Israel under the terms of the Old Covenant, you will not find eternal life offered. The promises under the Old Covenant included blessings in this physical life only.
But the New Covenant is based on better promises than the Old Covenant (Hebrews 8:6-8). One of those promises is forgiveness of sins (Jeremiah 31:31-34, especially verse 34). The penalty of sin is eternal death, but under the New Covenant, sins are forgiven and the penalty wiped out by the sacrifice of Christ, and the gift of eternal life is made available (Romans 6:23). There are a number of scriptures in the New Testament that confirm that eternal life is a promise under the terms of the New Covenant (1 John 2:24-25, John 3:16, John 6:54, John 10:27-28).
So when the man asked Jesus Christ what he had to do to obtain eternal life, he was asking a New Covenant question. Specifically, he was asking a question about the requirements of the New Covenant (Mark 10:17, Luke 18:18).
Jesus answered, "You know the commandments", and named several of the ten commandments (Mark 10:19, Luke 18:20).
In answering a question about New Covenant requirements for eternal life, Jesus pointed the man to the commandments he already knew. This was a man who was taught in the traditions of Israel and the commandments he knew since his youth were the ten commandments (Mark 10:20, Luke 18:21).
The man's question, and Jesus Christ's answer, had nothing to do with the Old Covenant. The man's question and Jesus's answer had to do with the New Covenant only. This is entirely a New Covenant doctrine.
So under the New Covenant, if you want eternal life, keep the ten commandments.
That the ten commandments are still in force after the death and resurrection of Christ is confirmed by James 2:10-11 which says that if you transgress one commandment you transgress all of them. Why? The reason James gives is important. He says, "For He who said, 'Do not commit adultery,' also said, 'Do not murder' ". In other words, it is because of WHO gave the commandments that we must obey them. Because God gave the commandments, we must obey all ten of them. It is clear that James is quoting from the ten commandments.