Skip to content

Using json like type variables to feed templates #138

Closed
@davidcassany

Description

@davidcassany

Hi all,

I am wondering how it can be done to use JSON like variables to feed a template. Basically what I am doing now is to pass a JSON as environment variable to container and then use it for templating config files (currently using python and jinja2 for templating). I'd like to use docker-gen utils for notifying and re-templating on the fly an nginx load balancer, then just to keep using the same templating engine everywhere I'd like to know how I could use docker-gen or dockerize to template nested data structures like:

{generic_var1: value1, generic_var2: value2, structured_vars: [{nested1: value3, nested2: value4}, {nested1: value5, nested2: value6}]}

Basically I am using it to define several location blocks in an nginx conf file. I don't see how to do it with not structured environment variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions