Genesis 39:20 – 40:8 20 Joseph’s master took him and put him in prison, the place where the king’s prisoners were confined. But while Joseph was there in the prison, 21 the LORD was with him; he showed him kindness and granted him favor in the eyes of the prison warden. 22 So the warden put Joseph in charge of all those held in the prison, and he was made responsible for all that was done there. 23 The warden paid no attention to anything under Joseph’s care, because the LORD was with Joseph and gave him success in whatever he did.
40 Some time later, the cupbearer and the baker of the king of Egypt offended their master, the king of Egypt. 2 Pharaoh was angry with his two officials, the chief cupbearer and the chief baker, 3 and put them in custody in the house of the captain of the guard, in the same prison where Joseph was confined. 4 The captain of the guard assigned them to Joseph, and he attended them. After they had been in custody for some time, 5 each of the two men—the cupbearer and the baker of the king of Egypt, who were being held in prison—had a dream the same night, and each dream had a meaning of its own. 6 When Joseph came to them the next morning, he saw that they were dejected.7 So he asked Pharaoh’s officials who were in custody with him in his master’s house, “Why do you look so sad today?” 8 “We both had dreams,” they answered, “but there is no one to interpret them.” Then Joseph said to them, “Do not interpretations belong to God? Tell me your dreams.”