简体   繁体   中英

Docker-compose MemoryError

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM