About docker images contextualization with LXC

Hello community!

I have been playing with containers using LXC and opennebula. I Have read the the example about deploying services with oneflow.

I want to deploy Odoo, so I have downloaded both Odoo 14 and PostgreSQL latest from dockerhub. By following the example in documentation I passed environment variables using the start script.

For Postgres I passed
export POSTGRES_DB = odoo
export POSTGRES_PASSWORD = mypassword
export POSTGRES_USER = odoo
nohup docker-entrypoint.sh postgres >> /tmp/postgresql.log 2>&1 &
onegate vm update --data READY=YES

For Odoo I passed
export HOST = 192.168.1.100
export PORT = 5432
export USER = odoo
export PASSWORD = mypassword
onegate vm update --data READY=yes

All variables I exported were the environment variables that each container defines according to their docker pages. However, when I instantiate the service the odoo site returns an error and from what I can see inside the containers, the parameters where not successfully passed.

Is there something I am missing with this contextualization?

Hi @Luis,

I’ve never used Odoo before, but maybe you’re missing a command for starting the service in your start script, something similar to this line you have in the postgres script:

nohup docker-entrypoint.sh postgres >> /tmp/postgresql.log 2>&1 &

Note that currently OpenNebula integration just export the file system of the container, so in order to automatically start any service it has to be added to the start script.

Also, note that these env variables are exported only when the start script is executed, so I think is normal not seeing them if you just log into the container.

Hi @cgonzalez, Indeed!

Thank you very much.

1 Like