Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
16778 Tampilan

Hello everyone,

I am testing Odoo using Docker and using standard command line arguments to start/stop containers.

Pull/Start:

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

After that, every time I need to start containers I use:

docker start db
docker start odoo

My question:

How can I start odoo container with odoo-bin parameters (-u module_name, -d database name, etc.)?

I have tried:

docker start odoo -- -u module name -d database_name

...and no luck

Can anyone help me please?

Thank you in advance


Avatar
Buang
Jawaban Terbai

Hello, -- -u module name -d database_name should be used with docker run.
To update your module, combine what you did in the run and in the start commands like that:

docker run -p 8069:8069 --name odoo --link db:db -t odoo -- -u module name -d database_name
Then you can use the start and stop commands again.

A better solution would be to use the docker-compose tool which is more convenient.  You could have a docker-compose.yml file similar to this one (adapt it for the odoo version you are running)

version: '2'
services:
  web:
    image: odoo:11.0
    depends_on:
      - db
    ports:
      - "8074:8069"
    volumes:
      - ./conf:/etc/odoo
      - ./my_addons:/mnt/extra-addons
    command: odoo -u module_name -d database_name
  db:
    image: postgres:9.4
    environment:
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
Notice the "command: odoo ..." line, it is where you will be able to add arguments.

Place this file at the root of your project and use "docker-compose up" and "docker-compose stop" to start and stop your project. You then modify only the docker-compose.yml file to choose odoo command-line arguments

Avatar
Buang
Penulis

Hello there,

Thank you very much for your reply.

So, I will have to delete (rm) my container and recreate it adding the desired parameters? Asking because I cannot have two container with same name.

And if I need to update several databases and/or specific parameters to send, will have to proceed the same way for every database?

After update process is finished, I will have to re-create the container once again since the parameters will be "saved" with the container startup parameters and do not want to start container always with those parameters?

Thank you once again

Penulis

I am new to docker and found an update command... "docker update container ... options".

Will try this one to see if I can update container run parameters...

I cannot answer more than one time per question, sorry. So I have updated my initial answer to a solution that may fit what you need.

Post Terkait Replies Tampilan Aktivitas
1
Jul 19
11719
1
Apr 25
2943
0
Mar 24
983
4
Des 23
44919
1
Jan 23
3203