Will it be posting DockerFile and DockerCompose in Github


(Markus Bala) #1

Hi,

As Tryton has own image in Docker, however, it do not have the Volume Mount to the modules.
It will be good to have it, because it might help the developer to use the docker for testing module when any update.

Another thing, any plan to post the Official DockerFile to github?

Best Regard


(Sergi Almacellas Abellana) #2

See: Issue 7736: Trunk based docker images - Tryton issue tracker

Dockerfiles are published on our own mercurial repositories, under the tryton-docker repository


(Nicolas Évrard) #3

I guess @bala4901 ask about if it will be mirrored to github.
(and I refrain myself from entering in this troll :smiley:).


(Sergi Almacellas Abellana) #4

Then the mirror script should be updated to include the tryton-docker repository


(Markus Bala) #5

@nicoe @pokoli yes, my mean is Dockerfiles to Github so that it can link to Docker Hub.

I had tried to custom the Dockerfile to have mount to “modules” folder. However, when mounting, the content inside the docker will be erased.

I remember old time has suggestion to custom module path at the config file - just like “addons path” in odoo. But it been rejected by @ced .
I do not know whether should I open this issue up again. Because, if able to custom the “Module” path. It will really very helpful for maintenance for custom module.


(Felipe Morato) #6

I personally find it easier to install my custom module python setup.py install or develop than relying on paths.


(Cédric Krier) #7

You do not need to have the Tryton Dockerfile on github for that because you should not create a new image from scratch to add your modules but you should extend the published image tryton/tryton:5.0.
Here is an example of Dockerfile we use for custom project (one repository with all the custom code):

FROM tryton/tryton:5.0 as builder
USER root
RUN mkdir /module
COPY . /module
WORKDIR /module
RUN python3 setup.py sdist

FROM tryton/tryton:5.0
USER root
COPY --from=builder /module/dist /dist
RUN pip3 install /dist/* \
    && rm -rf /root/.cache
USER trytond

The file is stored at the top of the repository and you just run docker build ..

It will still be rejected because installing a module should be done with setuptools in order to check the dependencies.


(Markus Bala) #8

Thank you for the Dockerfile.

A question, if during development, how you going to update the source code in the module and update to docker?


(Cédric Krier) #9

It always use the current source code of the repository/module. See:


(Kiril Vangelovski) #10

Maybe you can install the module in editable mode and declare it as a volume when building image:

RUN pip3 install -e /module
VOLUME ['/module']

Then bind it to host source dir:

docker run -v /host/path/to/module:/module ...

(Cédric Krier) #11

This is just a dummy folder to store temporary the module package that will be installed. At run time this folder does nothing. This idea of just dropping code in a folder is plain wrong, installation requires some checks and processing like: dependency, 2to3 conversion, compilation etc.


(Kiril Vangelovski) #12

I think the question is how to setup a development environment which I interpret as having a fast loop of updating and running the changes and not necessarily check dependencies, etc. IMO it is not viable to build a new image just to test each change, that is too slow.


(Cédric Krier) #13

There is no point to use Docker to develop. Developers must setup a development environment (virtualenv, pip, VCS etc.) which provides the fastest development loop.
Docker is for deployment.


(Kiril Vangelovski) #14

That is highly opinionated I believe. I tend to use Docker for development mostly and find it convenient to have all environment (including system packages, file system, etc.) separated.


(Markus Bala) #15

agree with @ced for developer should setup local env. However, sometime we only need to do some testing for some quick reference. In that case, docker will really help to short the setup time.


(Felipe Morato) #16

I have also tried using docker for development as many people have been talking about it in blogs and such but it was too slow. The fastest has been on a virtualenv.