Packaging Odoo based Docker
This page contains steps for packaging different components and add-ons, of a module into a docker image. These instructions must be helpful for System Integrators to add custom Odoo add-ons and create a package.
Procedure
The steps to package OpenG2P docker are given below.
Clone the https://github.com/OpenG2P/openg2p-packaging and go to the packaging directory.
Create a text file, for example
my-package.txt.
This signifies a package. This file should include all OpenG2P modules (repositories) to be packaged into a new docker. Each line describes one repository to include, and the structure of each line looks like this.
Any underscore in the repository name will be converted to a hyphen during installation. For example,
This is internally converted to
repo-name
.The above configuration can be made via environment variables also.
Any variable with the prefix
G2P_PACKAGE_my_package_
will be considered as a repository to install i.e.,G2P_PACKAGE_<package_name>_<repo_name>
. For example,These environment variables can be added in
.env
file (in the same folder). The.env
file will automatically be considered.If the same package is available in
my-package.txt
,.env,
and environment variable, then their preference order will be considered (highest to lowest)..env
file.Environment variable.
my-package.txt
Use the
.env
to overload packages frommy-package.txt
Run the following to download all packages.
After downloading packages, run the following to build docker image.
Then push the image.
Notes:
The above uses Bitnami's Odoo image as base.
This script also pulls in any OCA dependencies configured, in
oca_dependencies.txt
inside each package. Use this environment variable to change the version of OCA dependencies to be pulled,OCA_DEPENDENCY_VERSION
(defaults to15.0
).This also installs any python requirements configured in
requirements.txt
inside each package.Reference packages can be found in packages directory inside packaging directory.
Last updated