odoo on docker

KuDr42X_ITXghJhSInDZekNEF0jLt3NeVxtRye3tqco

If you are on any linux distro and you want to play with odoo on docker and if you have docker installed you are 2 command away.

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres
docker run -p 127.0.0.1:8069:8069 --name odoo --link db:db -t odoo

First command will pull and run the docker image postgres under the name “db”

The second command will pull and run the docker image odoo under the name odoo and will launch it to listen to port 8069 and forward it to you (the host) as the same port (8069) and finally will link it to the already runny “db” instance.

If you mac or windows the you will use boot2docker

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres
docker run -p 0.0.0.0.1:8069:8069 --name odoo --link db:db -t odoo

Then do port forwarding from machine > settings > network

forward the boot2docker vm port 8069 to your local 8069
Inline image 1

Inline image 2

Now restart the power off the machine and start boot2docker again.
When you are done do the following command:
docker start db odoo

Bonus:

docker run -v /path/to/addons:/mnt/extra-addons -p 127.0.0.1:8069:8069 --name odoo --link db:db -t odoo

If you are linux and you want to mount your local addons folder to the docker image.

Reference: https://registry.hub.docker.com/_/odoo/

Enjoy !