
Deploy a dynamic set of docker containers? - arun_bala
There is a dynamically generated list of containers that I&#x27;m trying to deploy. Is there a way to dynamically deploy a set of docker containers based on a list of them that you have? I think there is a way to do this for kubernetes using helm, where you can deploy a subset of charts conditionally, but is there a way to conditionally deploy docker containers or a subset of them? I think the only way to do that would be to use something like ansible + some messy &#x2F; complicated jinja style templating in a compose file? Is there a much easier way that I&#x27;m missing?
======
zoobab
Helm has conditionals, you can just cascade a different value files.

I did a similar thing last week, if you want I could try to post some example.

~~~
arun_bala
The application I'm trying to develop is just a normal compose based setup.
I'm trying to achieve the flexibility that helm gives us for Kube with docker
compose and need pointers in that direction.

My current approach was - given a set of containers - enable / disable flags
for them if they exist / don't exist and then create a compose file and then
have conditionals in it and have ansible deploy the containers ->

    
    
      # vars/containers.yml
      list_of_containers:
        - container1
        - container2
    
      # docker-compose.yml
      {% if container1_enabled %}
      container1:
        image: container1
        port: port1:port2
        ....
      {% endif %}

