Yes, the image is already build before. I ran the command : docker image ls and can see the image in the list.
Also, using the above command(mentioned in the first post) the container is getting created but the status shows exited, and am running this in the correct directory.
I have been following a lecture in Udemy and was doing the hand-on in parallel so this is where I got stuck.
Thanks for your suggestions. I cross checked everything and noticed that there was a small typo in the docker file. Once I fixed it, the issue got resolved.