Update all odoo modules in a docker container
Asked Answered
U

4

6

I am working on a Odoo Docker container. I tried to find the appropriate command to update all the modules through the command line there but in vain. What is the appropriate command to do so ? I've put docker restart container_name -u all but also in vain. Thanks in advance !

Unite answered 30/5, 2017 at 13:33 Comment(0)
L
6

If you are using the docker-compose up command to start your servers, then you need to add the following line to your docker-compose.yml file under the odoo service:

command: odoo -u all -d odoo-prod

Where odoo-prod is the name of your database. This overwrites the default command (which is just odoo without update) and tells docker to update all modules when the container restarts.

Alternatively, you can also run a separate container that performs the updates:

docker run -v [your volumes] odoo:10.0 odoo -u all -d odoo-prod

This also overwrites the command from the dockerfile with the command stated here that includes the update.

Letreece answered 27/9, 2017 at 8:9 Comment(0)
P
1

You should have an ENTRYPOINT or CMD in your Dockerfile that runs python odoo.py -u all, the -u all option is for Odoo not docker restart

Personate answered 31/5, 2017 at 9:25 Comment(1)
Hi danidee, i didn't get well your answer. Could you explain in detail what you mean by having an entry point in my docker file ?Unite
T
1

Open your container console

docker exec -it odoo bash

Update your module using other port

/usr/bin/odoo -p 8070 -d mydb -u mymodule

If the database it's on another container

/usr/bin/odoo -p 8070 --db_host=172.17.0.2 --db_user=odoo --db_password=odoo -d mydb -u mymodule
Tease answered 27/4, 2021 at 14:45 Comment(0)
K
0

If you are using docker compose, it can help you by placing this line inside your docker-compose.yml file in the odoo service

command: odoo -u all -d database_name

then run

docker compose up

or

docker-compose up

depending on the version.

If it updates correctly you can now remove the line inside the file and run again with

docker compose up -d
Kerrykersey answered 20/9 at 11:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.