dynamic link update in docker-compose
I am using docker compose to scale the docker containers. Is there any way to create the links dynamically? I am using --force-recreate option but I think it create a new container. I want to switch the link (HAProxy) to some other container dynamically. Any kind of help is appreciated. Thanks, Sanjiv
Yes, but you need a Docker-aware load balancer that is configured to do so. dockercloud/haproxy Docker produces and open-sources their own HAProxy image that does support this, and does not require your to --force-recreate. It does require v2 of docker-compose. https://github.com/docker/dockercloud-haproxy version: '2' services: web: image: dockercloud/hello-world lb: image: dockercloud/haproxy links: - web volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 80:80 Once the stack is up, you can scale the web service using docker-compose scale web=3. dockercloud/haproxy will automatically reload its configuration.
How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?
Jhipster Docker-compose conflict
Build multiple images with Docker Compose?
JHipster Cassandra Docker Build