Operation error when trying to connect with atlas cluster from docker container!

I have been trying this for the last 2 days and can’t seem to know what am I doing wrong. It would be great if anyone could help.
Here’s the problem:

This error is coming up when I’m trying to connect to MongoDB atlas from my docker container.
But when run it on my local machine it works perfectly and I am able to perform operations on the database…
Thank you…

Bad authentication means wrong user id/password combination
Check the credentials again

I did check that and created a new database user too but it still doesn’t seem to work… But I will check that again.