This Dockerfile will run the steps required to build a working image of
Tryton. The build is based on the
ubuntu base image provided by docker.
Fetch the repository from docker
docker pull openlabs/tryton
Create a new container using the image
docker run -d -p 8000 openlabs/tryton
-doption indicates that the container should be run in daemon
-poption and it's value
8000instructs docker to bind TCP port 8000
of the container to a dynamically allocated TCP port on all available
interfaces of the host machine.
See ports documentation
for a more detailed explanation on how the port exposed by the container is
bound to the host running the docker container.
To find the port that tryton in now bound to
The output in the PORTS column should look like
You should now be able to connect to tryton on the port 49153. (Note:
Substitute the port number with what is displayed on your docker host.)
To install the Tryton client in your machine, you can use virtualenv/virtualenvwrapper and pip:
sudo apt-get install virtualenvwrapper python-gtk2 mkvirtualenv --with-site-packages tryton workon tryton pip install tryton-client
To run it just call tryton from inside the virtualenv:
workon tryton tryton
SSH into the container (Deprecated)
The container originally did support SSH but was subsequently removed.
Running from docker container
You can access the docker container and work from within it.::
docker run -i -t openlabs/tryton /bin/bash
On execution of the command a new prompt within the container should be
available to you. Remember that trytond (default service) is not started
automatically for you when you access the container in this manner. To
start trytond, run::
trytond -c /etc/trytond.conf
This is a minimalistic Docker container for Tryton which could be used in
both production and developemnt. Further step if you intend on using this
as a base image is below.
Extending this image
This docker image is a minimal base on which you should extend and write
your own modules. The following example steps would be required to say
make your setup work with postgres and install the sale module.
# Trytond 3.2 with Sale module and Postgres # # VERSION 188.8.131.52 FROM openlabs/tryton:3.2 MAINTAINER Sharoon Thomas <firstname.lastname@example.org> # Setup psycopg2 since you want to connect to postgres # database RUN apt-get -y -q install python-dev libpq-dev RUN pip install psycopg2 # Setup the sale module since it is a required for this # custom setup RUN pip install 'trytond_sale>=3.2,<3.3' # Copy new trytond.conf from local folder to /etc/trytond.conf # The new trytond also has credentials to connect to the postgres # server which is accessible elsewhere ADD trytond.conf /etc/trytond.conf
This example can be downloaded as a gist.
- Ability to load configuration parameters from environment variables.
Authors and Contributors
This image was built at Openlabs.