Skip to content

Module for helping to create cloud config for running containers

License

Notifications You must be signed in to change notification settings

DevTable/container-cloud-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

container-cloud-config

Module for helping to create cloud config for running containers

Example

Python code

from container_cloud_config import CloudConfigContext
from jinja2 import FileSystemLoader, Environment, StrictUndefined

jinja_env = Environment(loader=FileSystemLoader('templates'), undefined=StrictUndefined)

config_context = CloudConfigContext()
config_context.populate_jinja_environment(jinja_env)

Jinja template code

# To retrieve an etcd discovery token:
token={{ new_etcd_discovery_token() }}

# To create systemd units for downloading and running a Docker image:
{{ dockersystemd('myserver',
                 'quay.io/mynamespace/myservice',
                 'mynamespace+deploy',
                 'robottokenorpassword',
                 'latest',
                 extra_args='--privileged -p 443:443 -p 80:80',
                 after_units=[],
                 flattened=True
                ) }}

Flattened/Squashed Images

Flattened (Squashed) images are currently only supported for repositories hosted on Quay.io.

Precaching flattened images

If flattened=True is used on the dockersystemd call, images can be precached by invoking the prime_flattened_image_cache method after the template has been invoked.

About

Module for helping to create cloud config for running containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages