Error setting up metabase with docker and AWS RDS postgres database

While trying to setup metabase with docker, I specified my AWS RDS postgres database credentials in the Environment variables but I got the error below

10-30 09:42:02 ERROR metabase.driver :: Failed to connect to database: java.sql.SQLException: No suitable driver found for jdbc:postgresql://*************.cwv7awwnqd0u.eu-west-2.rds.amazonaws.com:/ebdb” \-e MB_DB_PORT=5432 \-e MB_DB_USER=********”?OpenSourceSubProtocolOverride=true
10-30 09:42:02 ERROR metabase.core :: Metabase Initialization FAILED

Here is command to setup metabase, any help?

**docker run -d -p 3000:3000 \-e "MB_DB_TYPE=postgres" \-e "MB_DB_DBNAME=ebdb” \-e "MB_DB_PORT=5432" \-e "MB_DB_USER=*****************” \-e "MB_DB_PASS=******************" \-e "MB_DB_HOST=postgres://*********************.cwv7awwnqd0u.eu-west-2.rds.amazonaws.com" \--name metabase metabase/metabase**

You’ll wanna put the port (5432) into the MB_DB_HOST, I had a similar issue issue using DATABASE_URL / MB_DB_CONNECTION_URI where I hadn’t put in any port.

So postgres://*********************.cwv7awwnqd0u.eu-west-2.rds.amazonaws.com should become postgres://*********************.cwv7awwnqd0u.eu-west-2.rds.amazonaws.com:5432.

Additional context

I was getting No suitable driver found:

SEVERE: Error in url: jdbc:postgresql://*****.*****.eu-west-1.rds.amazonaws.com:/peergrade?OpenSourceSubProtocolOverride=true
ERROR metabase.driver :: Failed to connect to database: java.sql.SQLException: No suitable driver found for jdbc:postgresql://*****.*****.eu-west-1.rds.amazonaws.com:/peergrade?OpenSourceSubProtocolOverride=true
java.lang.AssertionError: Assert failed: Unable to connect to Metabase postgres DB.
(binding [*allow-potentailly-unsafe-connections* true] (require (quote metabase.driver)) ((resolve (quote metabase.driver/can-connect-with-details?)) engine details))
...
Initialization FAILED:  Assert failed: Unable to connect to Metabase postgres DB.
(binding [*allow-potentailly-unsafe-connections* true] (require (quote metabase.driver)) ((resolve (quote metabase.driver/can-connect-with-details?)) engine details))
INFO metabase.core :: Metabase Shutting Down ...
INFO metabase.core :: Metabase Shutdown COMPLETE
State changed from up to crashed
Process exited with status 1

check the security group of RDS database and also of EC2 instance where you are running the container.
try doing telnet to ******.cwv7awwnqd0u.eu-west-2.rds.amazonaws.com 5432 from your container machine.