docker-compose


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.

Related Links

How to use visual studio docker function on Windows Home edition?
Passing arguments to docker compose file when using it for swarm
How to run ad hoc docker compose commands in Ansible?
Using custom hostnames for docker local development containers
Changing the network name?
Let external container know about subnets created by multiple docker-compose projects
How to monitor / discover more docker containers with prometheus
two docker-compose .yml in the same network with COMPOSE_PROJECT_NAME
docker compose 3.1(swarm), secrets, ssl and nginx
What is the version directive for?
How to run docker-compose up -d at system start up?
In Docker Compose can I have services exiting
Docker compose - secrets Additional property secrets is not allowed
docker-compose mounted volume remain
Should I do anything after upgrading docker-compose?
docker caddy proxy not forwarding

Categories

HOME
ckan
azure-documentdb
redux
stanford-nlp
cxf
casting
reference
conceptual
okhttp3
salesforce-lightning
uml-designer
python-3.4
markdown
google-api-oauth
samsung-gear-s2
pyodbc
digital
google-search-appliance
hdf5
infopath
jsfiddle
vivado-hls
views
udeploy
descriptor
inline-assembly
prepros
suitescript
bytebuffer
emr
csproj
jms-topic
ocl
boost-log
lines
keil
imdb
oracle-nosql
cocoa-scripting
kdevelop
jibx
iterm2
lfe
bzip2
html-entities
visio-2010
jenkins-docker
kendo-scheduler
programming-pearls
easy-thumbnails
dbi
ldd
access-violation
mrunit
jde
pyshark
dcast
apache2-module
dynamics-nav
jcomponent
mojolicious
taverna
bootstrap-tabs
clearquest
sicstus-prolog
strcpy
connection-timeout
drools-guvnor
xmlserializer
fscanf
sendy
nodeunit
nvcc
autofilter
facebook-likebox
mysql2
pageload
pymel
dnsbl
ncml
unordered-set
yii-cactiverecord
azure-appfabric
onresize
cross-cutting-concerns

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App