docker icon indicating copy to clipboard operation
docker copied to clipboard

Cannot work with external databases i.e. AWS RDS Postgres

Open irepan opened this issue 5 years ago • 3 comments

The Environment variable HOST is not working properly:

$ docker run -p 8069:8069 --name odoo -t odoo -e HOST=3.82.97.29 -e PORT=5432 -e USER=XXXXXXXX -e PASSWORD=XXXXXXXXXXXXXXX Unable to find image 'odoo:latest' locally latest: Pulling from library/odoo bc51dd8edc1b: Pull complete 65612bcd6c31: Pull complete 0a59b34b423f: Pull complete c777e556ebc3: Pull complete d82a3171af1a: Pull complete c1fdba9aca9c: Pull complete 7cf602847309: Pull complete e7e56222b439: Pull complete 424f1ae3150f: Pull complete Digest: sha256:41c93959d1ff41266fd0d26f58bec3361120268c3f54e66958b2c12fec2083e2 Status: Downloaded newer image for odoo:latest Database connection failure: could not translate host name "db" to address: Name or service not known

like somehow this code: : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} : ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}

is not working properly in the entrypoint script, for start I see an error envolving DB_PORT_5432_TCP_ADDR (Wherever its value comes from) into the HOST definition

irepan avatar Feb 05 '20 16:02 irepan

There is a mistake in your command, the -e HOST=3.82.97.29 -e PORT=5432 -e USER=XXXXXXXX -e PASSWORD=XXXXXXXXXXXXXXX args should come before the image name. Otherwise they are seen as odoo arguments. As stated in the documentation

d-fence avatar Apr 17 '20 07:04 d-fence

I can confirm it does connect to an external RDS db. Host flag worked as expected.

Saraujoc92 avatar Jul 15 '21 09:07 Saraujoc92

@irepan can you close this issue out please?

lathama avatar Apr 03 '24 16:04 lathama