4 ms·
Deploy a dynamic set of docker containers?
There is a dynamically generated list of containers that I'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 / complicated jinja style templating in a compose file? Is there a much easier way that I'm missing?
- zoobab 8y agoHelm 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 8y agoThe 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 %}