Skip to main content

Odootools script to generate docker images

Project description

Odootools Docker

Integrate itself into odootools to generate a Dockerfile that can completely configure a base Docker Image.

The Dockerfile is built by generating a context from certain configuration.

The context itself is simply a JSON serialized text that can be obtained from provided utilities or anywhere that can output a JSON to stdout.

When the context is ready, it can be passed to the render function that will load all required templates to generate the Dockerfile.

Here's a simple example to build an Odoo15 image.

odootools docker context -v 15 | odootools docker render

Here's an example adding whtmltopdf utilities:

odootools docker context -v 15 \
| odootools docker wkhtmltopdf \
| odootools docker render

Working with odootools Docker

Odootools docker is a bit more than just a script to build docker images. It can be extended by defining your own templates that can get loaded based on the provided context.

The external templates can be provided in the context through the key template_dirs.

Then the steps list can be used to add/remove steps in the context. Those are the main templates that will get loaded by the Dockerfile renderer in the provided order.

For example:

{
  "template_dirs": "/custom/templates",
  "steps": [
    "a",
    "b",
    "c",
  ]
}

Will lookup for the template name a.jinja, b.jinja, c.jinja from /custom/templates first, then from the installed package odootools_docker.

It's possible to completely overwrite the way the context is rendered.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odootools_docker-0.1.0.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

odootools_docker-0.1.0-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page