5

I try to launch odoo on vps with 512 Mb RAM. I use docker. When I launch containers with plain docker everything is fine. I launch like that: postgres container:

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres

odoo container:

docker run -p 8069:8069 --name odoo --link db:db -t odoo

No errors, everything is working fine. Then I shutdown, remove this containers and try to do same thing with docker-compose:

app:
    image: odoo
    tty: true
    ports:
        - "8069:8069"
    volumes:
        - ./addons:/mnt/extra-addons:ro,Z
    links:
        - db:db

db:
    image: postgres
    environment:
        POSTGRES_USER: odoo
        POSTGRES_PASSWORD: odoo

And when I launch I get MemoryError:

root@ubuntu-512mb-fra1-01:~/odoo# docker-compose -f odoo.yml up
Creating odoo_db_1
Creating odoo_app_1
Attaching to odoo_db_1, odoo_app_1
db_1   | The files belonging to this database system will be owned by user "postgres".
db_1   | This user must also own the server process.
db_1   | 
db_1   | The database cluster will be initialized with locale "en_US.utf8".
db_1   | The default database encoding has accordingly been set to "UTF8".
db_1   | The default text search configuration will be set to "english".
db_1   | 
db_1   | Data page checksums are disabled.
db_1   | 
db_1   | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1   | creating subdirectories ... ok
db_1   | selecting default max_connections ... 100
db_1   | selecting default shared_buffers ... 128MB
db_1   | selecting dynamic shared memory implementation ... posix
db_1   | creating configuration files ... ok
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.9.0', 'console_scripts', 'docker-compose')()
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 65, in main
    command()
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 117, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 862, in up
    log_printer.run()
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/log_printer.py", line 87, in run
    for line in consume_queue(queue, self.cascade_stop):
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/log_printer.py", line 229, in consume_queue
    raise item.exc
MemoryError

I tried to google the reason, but couldn't find anything.

3
  • 3
    The memory error is coming from docker-compose, not your application. Maybe 512mb isn't enough to run compose & postgres. Commented Nov 17, 2016 at 10:27
  • 1
    @johnharris85 seems to be right. I've ran your command on my machine and it worked fine. I think you just need to give postgres enough memory to work with, or configure its parameters to try to work with less memory (which won't work in my opinion, is 512mb doesn't sound like enough memory for a db instance) Commented Nov 17, 2016 at 11:12
  • On my local machine docker-compose creates containers just fine too. But I thought if plain docker can create containers one by one, why docker-compose cant? Also, I worked with installed application later, added some modules, so db is working fine and have not received any errors. After I ran containers by plain docker. Commented Nov 17, 2016 at 13:20

2 Answers 2

6

The command that is being run buffers json so that it can split it correctly. It's possible that buffering is using up too much memory.

You could try this instead:

docker-compose -f odoo.yml up -d 

That will run "detached". You can still try running docker-compose logs to see the logs.

Sign up to request clarification or add additional context in comments.

Comments

-1

You could try to remove tty:true in the odoo.yml

From https://github.com/docker/compose/issues/3106

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.