Genesis 40:1-6 NKJV

1 It came to pass after these things that the butler and the baker of the king of Egypt offended their lord, the king of Egypt.
2 And Pharaoh was angry with his two officers, the chief butler and the chief baker.
3 So he put them in custody in the house of the captain of the guard, in the prison, the place where Joseph was confined.
4 And the captain of the guard charged Joseph with them, and he served them; so they were in custody for a while.
5 Then the butler and the baker of the king of Egypt, who were confined in the prison, had a dream, both of them, each man's dream in one night and each man's dream with its own interpretation.
6 And Joseph came in to them in the morning and looked at them, and saw that they were sad.