Dockerfile for Tryton Server
The image provided by this Dockerfile is a minimalistic Docker container
for Tryton server
- that works out of the box,
- follows best practices for Dockerfiles,
- is meant to be extended to fit your personal needs. For further steps see below.
If you don't have yet a running docker installation, install first
sudo apt-get install docker.io
Add the user, that will use docker, to the docker group
sudo useradd myuser docker
Note: You may have to relogin before the group settings will take effect.
Fetch the repository from docker
sudo docker pull mbsolutions/tryton-server
Note: To fetch and work with specific versions add the relative tag to the command like
sudo docker pull mbsolutions/tryton-server:4.6
Run a new container using the image
sudo docker run -d -p 8000:8000 mbsolutions/tryton-server
-doption indicates that the container should be run in daemon
-poption and it's value
8000:8000instructs docker to bind TCP port 8000
of the container to port 8000 on the host. For more options on binding the interfaces
of containers to the host machine see the
The creation of new databases is done with
trytond-admin inside the container.
For more information have a look at the documentation of the
This image image uses several environment variables which are not required,
but may significantly aid in using the image.
This environment variable can be used to set the database connection.
Use "-e TRYTOND_DATABASE_URI=postgresql://user:password@localhost:5432/" in "docker run".
Accessing the docker container
You can access the docker container and work from within it.
sudo docker exec -it mbsolutions/tryton-server /bin/bash
On execution of the command a new prompt within the container should be
available to you.
Extending this image
This docker image is a minimal base on which you should extend and write
If you would like to do additional initialization
before the startup of the server
in an image derived from this one, add an
*.sh script under
The entrypoint script will source any
*.sh script found in that directory
to do further initialization before starting the service.
The following example steps would be required to say make your setup work with postgres
and install the sale module. In case you want install all available modules use tryton-modules-all
# Tryton Server with Sale module and Postgres FROM mbsolutions/tryton-server:4.6 MAINTAINER Mathias Behrle <email@example.com> # Install additional distribution packages RUN apt-get update && apt-get install -y \ tryton-modules-sale \ && rm -rf /var/lib/apt/lists/* # Get a [sample trytond.conf](https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=tryton/tryton-server.git;a=blob_plain;f=debian/trytond.conf;hb=refs/heads/debian), # copy it to the directory of your Dockerfile, # adjust the settings to your needs (e.g. connection parameters and credentials to your PostgreSQL server) # and copy it into the container with COPY trytond.conf /etc/tryton/trytond.conf
Authors and Credits
This image was built by MBSolutions.
Parts of the setup were adopted from
For any questions about this image and your docker setup contact us at support.