Search code examples
python-3.xdockertryton

su password in tryton docker


I'm trying to setup a tryton demo, and I want to define my own modules inside the docker containers I'm using (these => https://hub.docker.com/r/tryton/tryton).

I try to create a new directory in the /home directory, in order to define there my own tryton modules, but I do not have enough permission so I execute su. The problem is that I do not know the root password.

Does anyone know which is it? Or, where should I define my tryton modules inside the docker container?


Solution

  • You should build a derivative image and install your modules there.

    Here is a sample Dockerfile which can be used to install custom modules:

    FROM tryton/tryton
    RUN pip3 install <package_name> && rm -rf /root/.cache 
    USER trytond
    

    You can also copy modules from your current directory with as following:

    FROM tryton/tryton
    COPY <route_to_your_module> /usr/src/module_name/
    USER root
    # Install module and it's dependencies
    RUN pip3 install /usr/src/module_name/ && rm -rf /root/.cache
    USER trytond     
    

    Hope it helps!